private AuditContext CreateContext(AuditEvent auditEvent) { #if NET45 if (DbConnectionBuilder != null) { return(new AuditContext(DbConnectionBuilder.Invoke(auditEvent), SetDatabaseInitializerNull, true)); } else { return(new AuditContext(ConnectionStringBuilder?.Invoke(auditEvent), SetDatabaseInitializerNull)); } #else if (DbContextOptionsBuilder != null) { return(new AuditContext(ConnectionStringBuilder?.Invoke(auditEvent), DbContextOptionsBuilder.Invoke(auditEvent))); } else { return(new AuditContext(ConnectionStringBuilder?.Invoke(auditEvent))); } #endif }
public DbConnectionTests() { jsonDataReader = new JsonDataReader(); dbConnectionFactory = new DbConnectionFactory(); dbConnectionBuilder = new DbConnectionBuilder(); }