Base solution for your next web application
Open Closed

Is there a way to prevent the LastModifierUserId, LastModificationTime, and AbpEntityChanges from occurring when an entity is updated? #11217


User avatar
0
ITWebTeam created
  • AspNetZero v11.1.0
  • MVC
  • .net core

Hi, I am looking to update rows in a table that is Audited but in this specific instance I want to update the data and prevent the LastModifierUserId, LastModificationTime columns from being automatically updated. I also would like to prevent the ABP Entity Change tables from logging the change. Is it possible to turn off auditing as needed on a per method basis?

Thank you


1 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    For auditing fields, you can use;

    using (_unitOfWorkManager.Current.DisableAuditing(AbpAuditFields.CreatorUserId))
    {
    
    }
    
    using (_unitOfWorkManager.Current.EnableAuditing(AbpAuditFields.DeleterUserId))
    {
    
    }
    

    It seems like it is not possible or very easy to disable entity history in such a way. If you can create an issue on https://github.com/aspnetboilerplate/aspnetboilerplate, we can implement it.