public static void EnableSqlServerCommandCatcher(this ExtensionsDbContextOptionsBuilder optionsBuilder)
        {
            optionsBuilder.OptionsBuilder
            .ReplaceService <IRelationalConnection, ExtensionsSqlServerConnection>();
            var infra = (IDbContextOptionsBuilderInfrastructure)optionsBuilder.OptionsBuilder;

            infra.AddOrUpdateExtension(new SqlServerCommandCatcherExtension());
        }
 public static void UseSqlServer <TContext>(this ExtensionsDbContextOptionsBuilder <TContext> optionsBuilder, DbConnection connection, Action <SqlServerDbContextOptionsBuilder> sqlServerOptionsAction = null) where TContext : DbContext
 {
     optionsBuilder.OptionsBuilder
     .UseSqlServerServices()
     .UseSqlServer(connection, sqlServerOptionsAction);
 }
 public static void UseInMemoryDatabase(this ExtensionsDbContextOptionsBuilder optionsBuilder, string databaseName, InMemoryDatabaseRoot databaseRoot, Action <InMemoryDbContextOptionsBuilder> inMemoryOptionsAction = null)
 {
     optionsBuilder.OptionsBuilder
     .UseInMemoryDatabaseServices()
     .UseInMemoryDatabase(databaseName, databaseRoot, inMemoryOptionsAction);
 }
 public static void UseSqlServer(this ExtensionsDbContextOptionsBuilder optionsBuilder, string connectionString, Action <SqlServerDbContextOptionsBuilder> sqlServerOptionsAction = null)
 {
     optionsBuilder.OptionsBuilder
     .UseSqlServerServices()
     .UseSqlServer(connectionString, sqlServerOptionsAction);
 }
 public static void UseInMemoryDatabase <TContext>(this ExtensionsDbContextOptionsBuilder <TContext> optionsBuilder, string databaseName, Action <InMemoryDbContextOptionsBuilder> inMemoryOptionsAction = null) where TContext : DbContext
 {
     optionsBuilder.OptionsBuilder
     .UseInMemoryDatabaseServices()
     .UseInMemoryDatabase(databaseName, inMemoryOptionsAction);
 }