public class AuditingStore : IAuditingStore { private readonly IRepository<Auditlogs, long> _auditLogRepository; public AuditingStore(IRepository<Auditlogs, long> auditLogRepository) { _auditLogRepository = auditLogRepository; } public Task SaveAsync(AuditInfo auditInfo) { return _auditLogRepository.InsertAsync(Auditlogs.CreateFromAuditInfo(auditInfo)); } }
///替换默认审计服务实现 Configuration.ReplaceService(typeof(IAuditingStore), () => { IocManager.Register<IAuditingStore, AuditingStore>(DependencyLifeStyle.Transient); });
链接:https://www.jianshu.com/p/bbcd046ef35d
来源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。