Change MaxValueLenght for NewValue and OriginalValue properties in EntityPropertyChange
See original GitHub issueHi,
i have problem with NewValue
and OriginalValue
related with this closed issue:
https://github.com/aspnetboilerplate/aspnetboilerplate/issues/4203
like as @mwj033 mentioned in above issue, OnModelCreating
did not any effect. @ryancyq sugestion is not enough to solve this problem.
Yes, in database NewValue
column was changed to character varying (1024 * 6)
, but when repository insert property change ORM entity, NewValue
is truncated to 512 chars.
I was tried to replace DbSet
using new
keyword and change EntityHistory
objects
public new DbSet<TopEntityChange> EntityChanges { get; set; }
public new DbSet<TopEntityPropertyChange> EntityPropertyChanges { get; set; }
where NewValue
and OriginalValue
are overrided
[Table("AbpEntityPropertyChanges")]
public class TopEntityPropertyChange: EntityPropertyChange
{
public override string NewValue { get; set; }
public override string OriginalValue { get; set; }
public new const int MaxValueLength = 1024 * 6;
}
but did not help.
Have you any idea how to increase number of chars for NewValue
and OriginalValue
?
Issue Analytics
- State:
- Created a year ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
How can I change MaxValueLength of NewValue and ...
I am using aspnetzero and I have enabled entity history. Maxvaluelength of NewValue and OriginalValue is 512 chars in ...
Read more >Increase size of EntityPropertyChange.NewValue ...
Is it possible to change 'EntityPropertyChange.MaxValueLength' to a static variable, just like in auditlog?
Read more >EntityHistory Property change value equality check with ...
OriginalValue == propertyChange.NewValue The equality check for OrignalValue and NewValue is inaccurate when the values are large ...
Read more >AuditLog remove MaxLength constraint on OriginalValue and ...
In the Constructor (shown in codeblock below) of the EntityPropertyChange it truncates the value based upon MaxNewValueLength and ...
Read more >C# (CSharp) EntityEntry.Property Examples
OriginalValue.ToJsonString().TruncateWithPostfix(EntityPropertyChange.MaxValueLength), PropertyName = property.Name, PropertyTypeFullName = property.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes! Correct!
Remaining steps:
EntityHistoryHelper
and its methodCreateEntityPropertyChange
. Apply a new extended model instead ofEntityPropertyChange
(I changed toFullEntityPropertyChange
).Configuration.ReplaceService<IEntityHistoryHelper, MyEntityHistoryHelper>(DependencyLifeStyle.Transient);
Thanks @ismcagdas it works 👍
@ismcagdas thank you very much. I will check wheteher your tip working.