ABP框架 替换默认审计实现

实现IAuditingStore接口

   public class AuditingStore : IAuditingStore
    {
        private readonly IRepository _auditLogRepository;

        public AuditingStore(IRepository auditLogRepository)
        {
            _auditLogRepository = auditLogRepository;
        }

        public Task SaveAsync(AuditInfo auditInfo)
        {
            return _auditLogRepository.InsertAsync(Auditlogs.CreateFromAuditInfo(auditInfo));
        }
    }
 public class Auditlogs : Entity, IMayHaveTenant
    { /// 
      /// Maximum length of  property.
      /// 
  prop Name{get;set;
}

///替换默认审计服务实现
Configuration.ReplaceService(typeof(IAuditingStore), () =>
{
IocManager.Register(DependencyLifeStyle.Transient);
});

你可能感兴趣的:(ABP框架 替换默认审计实现)