Enable audit log extensions

pull/3831/head
Halil İbrahim Kalkan 5 years ago
parent 644479a0b8
commit aea81e4fd9

@ -0,0 +1,35 @@
using System;
using Volo.Abp.ObjectExtending.Modularity;
namespace Volo.Abp.ObjectExtending
{
public class AuditLoggingModuleExtensionConfiguration : ModuleExtensionConfiguration
{
public AuditLoggingModuleExtensionConfiguration ConfigureAuditLog(
Action<EntityExtensionConfiguration> configureAction)
{
return this.ConfigureEntity(
AuditLoggingModuleExtensionConsts.EntityNames.AuditLog,
configureAction
);
}
public AuditLoggingModuleExtensionConfiguration ConfigureAuditLogAction(
Action<EntityExtensionConfiguration> configureAction)
{
return this.ConfigureEntity(
AuditLoggingModuleExtensionConsts.EntityNames.AuditLogAction,
configureAction
);
}
public AuditLoggingModuleExtensionConfiguration ConfigureEntityChange(
Action<EntityExtensionConfiguration> configureAction)
{
return this.ConfigureEntity(
AuditLoggingModuleExtensionConsts.EntityNames.EntityChange,
configureAction
);
}
}
}

@ -0,0 +1,18 @@
using System;
using Volo.Abp.ObjectExtending.Modularity;
namespace Volo.Abp.ObjectExtending
{
public static class AuditLoggingModuleExtensionConfigurationDictionaryExtensions
{
public static ModuleExtensionConfigurationDictionary ConfigureAuditLogging(
this ModuleExtensionConfigurationDictionary modules,
Action<AuditLoggingModuleExtensionConfiguration> configureAction)
{
return modules.ConfigureModule(
AuditLoggingModuleExtensionConsts.ModuleName,
configureAction
);
}
}
}

@ -0,0 +1,16 @@
namespace Volo.Abp.ObjectExtending
{
public static class AuditLoggingModuleExtensionConsts
{
public const string ModuleName = "AuditLogging";
public static class EntityNames
{
public const string AuditLog = "AuditLog";
public const string AuditLogAction = "AuditLogAction";
public const string EntityChange = "EntityChange";
}
}
}

@ -1,6 +1,8 @@
using Volo.Abp.Auditing;
using Volo.Abp.Domain;
using Volo.Abp.Modularity;
using Volo.Abp.ObjectExtending;
using Volo.Abp.ObjectExtending.Modularity;
namespace Volo.Abp.AuditLogging
{
@ -9,6 +11,25 @@ namespace Volo.Abp.AuditLogging
[DependsOn(typeof(AbpAuditLoggingDomainSharedModule))]
public class AbpAuditLoggingDomainModule : AbpModule
{
public override void PostConfigureServices(ServiceConfigurationContext context)
{
ModuleExtensionConfigurationHelper.ApplyEntityConfigurationToEntity(
AuditLoggingModuleExtensionConsts.ModuleName,
AuditLoggingModuleExtensionConsts.EntityNames.AuditLog,
typeof(AuditLog)
);
ModuleExtensionConfigurationHelper.ApplyEntityConfigurationToEntity(
AuditLoggingModuleExtensionConsts.ModuleName,
AuditLoggingModuleExtensionConsts.EntityNames.AuditLogAction,
typeof(AuditLogAction)
);
ModuleExtensionConfigurationHelper.ApplyEntityConfigurationToEntity(
AuditLoggingModuleExtensionConsts.ModuleName,
AuditLoggingModuleExtensionConsts.EntityNames.EntityChange,
typeof(EntityChange)
);
}
}
}

Loading…
Cancel
Save