Beispiel #1
0
        public static DbContextOptionsBuilder ConfigureDatabase(this DbContextOptionsBuilder builder, IConfiguration configuration)
        {
            var connectionString = configuration.GetConnectionString();

            if (string.IsNullOrEmpty(connectionString))
            {
                return(builder.ConfigureInMemoryDatabase());
            }
            else
            {
                return(builder
                       .ConfigureSqlServerDatabase(connectionString));
            }
        }