[Feature Request] Add an API to disable Entity History for specific controller\AppService method or to ommit EntityChanges without PropertyChanges
See original GitHub issueHere is a simple use-case: let’s assume that we have following entity:
[Audited]
public class MyEntity : Entity
{
public string MyProperty1 { get; set; }
[DisableAuditing]
public int MyProperty2 { get; set; }
public long MyProperty3 { get; set; }
}
Every time ChangeTracker detects a change, we add a new EntityChangeSet (as well as corresponding EntityChange(s)), but an issue occurs when MyProperty2
(the one which is not audited) is the only property which is changing: EntityPropertyChanges
of related EntityChange will contain no elements and is both counter intuitive (it makes no sense to have empty entry in entity history; viewing details of such entity changes in ‘Change Logs’ tab is confusing as the pop-up with details is actually empty).
Is there a (1) way to either temporary disable entity history for specific controller\method or (2) way to fix the issue when EntityChangeSet\EntityChange is being created when there are no PropertyChanges present?
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (8 by maintainers)
Top GitHub Comments
If you can upgrade to Abp 4.11 then you will be able to use the approach I suggested at https://github.com/aspnetboilerplate/aspnetboilerplate/issues/5093#issuecomment-562060755 (a fix for entity history selectors was merged for Abp 4.11, https://github.com/aspnetboilerplate/aspnetboilerplate/pull/4998)
Otherwise, Abp 5.0 is still pending on a fix at https://github.com/aspnetboilerplate/aspnetboilerplate/pull/4953 to use the approach https://github.com/aspnetboilerplate/aspnetboilerplate/issues/5093#issuecomment-562060755 (to be release with abp 5.1)
Everything is working as expected after updating to 4.11 packages. Thanks for contributing into the development of entity history module and responding so fast.
IMHO, it’s worth mentioning the difference between using
AuditedAttribute
andConfiguration.EntityHistory.Selectors
in documentation.