Ejemplo n.º 1
0
 private Action <DbContextOptionsBuilder> GetConfigurationForInMemoryDatabase(DbConfiguration dbConfiguration)
 {
     return(dbConfiguration.InMemoryDatabaseProvider switch
     {
         InMemoryDatabaseProvider.Sqlite => this._inMemorySqlite.Create(),
         InMemoryDatabaseProvider.EfCore => this._inMemoryEfDatabase.Create(),
         _ => throw new NotSupportedException("Not supported database provider")
     });
Ejemplo n.º 2
0
        public Action <DbContextOptionsBuilder> Create(DbConfiguration dbConfiguration)
        {
            if (dbConfiguration.DatabaseProvider.HasValue)
            {
                return(this.GetConfigurationWithRealDatabase(dbConfiguration));
            }

            return(this.GetConfigurationForInMemoryDatabase(dbConfiguration));
        }