public AuditTrailProvider(AuditConfiguration auditConfigurationSqlServer,
                           AuditContext auditContext,
                           IHttpContextAccessor httpContextAccessor)
 {
     this.auditConfigurationSqlServer = auditConfigurationSqlServer ?? throw new ArgumentNullException(nameof(auditConfigurationSqlServer));
     this.auditContext        = auditContext ?? throw new ArgumentNullException(nameof(auditContext));
     this.httpContextAccessor = httpContextAccessor ?? throw new ArgumentNullException(nameof(httpContextAccessor));
 }
 public AuditSqlServerDapperInitializer(AuditConfiguration auditConfigurationSqlServer,
                                        AuditContext auditContext,
                                        ILoggerFactory loggerFactory)
 {
     this.auditConfigurationSqlServer = auditConfigurationSqlServer ?? throw new ArgumentNullException(nameof(auditConfigurationSqlServer));
     this.auditContext = auditContext ?? throw new ArgumentNullException(nameof(auditContext));
     logger            = loggerFactory?.CreateLogger <AuditSqlServerDapperInitializer>() ?? throw new ArgumentNullException(nameof(loggerFactory));
 }
Esempio n. 3
0
 public AuditContext(AuditConfiguration auditConfigurationSqlServer)
 {
     this.auditConfigurationSqlServer = auditConfigurationSqlServer ?? throw new ArgumentNullException(nameof(auditConfigurationSqlServer));
     connection = new SqlConnection(this.auditConfigurationSqlServer.SqlServer.ConnectionString);
 }
        public static IServiceCollection AddFurizaAuditWithSqlServerAndDapper(this IServiceCollection services, FurizaSqlServerDapper.AuditConfiguration auditConfigurationSqlServer)
        {
            if (services == null)
            {
                throw new ArgumentNullException(nameof(services));
            }

            services.AddSingleton(auditConfigurationSqlServer ?? throw new ArgumentNullException(nameof(auditConfigurationSqlServer)));
            services.AddTransient <AuditContext>();
            services.AddScoped <IAuditTrailProvider, AuditTrailProvider>();
            services.AddScoped <AuditSqlServerDapperInitializer>();

            return(services);
        }