Esempio n. 1
0
 public static IEFCoreOrchestrationBuilder UseInMemoryDatabase(
     this IEFCoreOrchestrationBuilder builder,
     string databaseName,
     Action <InMemoryDbContextOptionsBuilder> inMemoryOptionsAction = null)
 {
     return(builder.UseInMemoryDatabase(databaseName, null, inMemoryOptionsAction));
 }
Esempio n. 2
0
        public static IEFCoreOrchestrationBuilder UseInMemoryDatabase(
            this IEFCoreOrchestrationBuilder builder,
            string databaseName,
            InMemoryDatabaseRoot databaseRoot,
            Action <InMemoryDbContextOptionsBuilder> inMemoryOptionsAction = null)
        {
            builder.Services.AddSingleton <OrchestrationDbContextExtensions, InMemoryOrchestrationDbContextExtensions>();

            return(builder.ConfigureDbContext(options =>
            {
                options.UseInMemoryDatabase(databaseName, databaseRoot, inMemoryOptions =>
                {
                    inMemoryOptionsAction?.Invoke(inMemoryOptions);
                });
            }));
        }
        public static IEFCoreOrchestrationBuilder UseSqlServer(
            this IEFCoreOrchestrationBuilder builder,
            string connectionString,
            Action <SqlServerDbContextOptionsBuilder> mysqlOptionsAction = null)
        {
            builder.Services.AddSingleton <OrchestrationDbContextExtensions, SqlServerOrchestrationDbContextExtensions>();

            return(builder.ConfigureDbContext(options =>
            {
                options.UseSqlServer(connectionString, sqlServerOptions =>
                {
                    var assemblyName = typeof(SqlServerEFCoreOrchestrationBuilderExtensions).Assembly.GetName().Name;
                    sqlServerOptions.MigrationsAssembly(assemblyName);
                    mysqlOptionsAction?.Invoke(sqlServerOptions);
                });
            }));
        }