Enabling AuditLog EnityChanges for IdentityUser in ABP Framework

409 views Asked by At

Enabling AuditLog EnityChanges for IdentityUser in ABP Framework.

Finally found this after hours of best practice search.

1

There are 1 answers

0
Kishore Sahasranaman On BEST ANSWER

Adding IdentityUser to EntityHistorySelectors will enable audting.

     public class SampleDomainModule : AbpModule
        {
            public override void ConfigureServices(ServiceConfigurationContext context)
            {
                //Enable AuditLog EntityChanges for IdentityUser
                Configure<AbpAuditingOptions>(options =>
                {
                    options.EntityHistorySelectors.Add(new NamedTypeSelector("AuditIdentityUser",type => typeof(IdentityUser).IsAssignableFrom(type)));
                });
    
                Configure<AbpMultiTenancyOptions>(options =>
                {
                    options.IsEnabled = MultiTenancyConsts.IsEnabled;
                });
            }
        }