Exemplo n.º 1
0
        public static String GetConnectionString(this DbOptions options, Type dbContextType)
        {
            var settings = options.DbContextSettings.GetOrDefault(dbContextType, () => DbContextSettings.CreateDefault(options.DefaultConnectionName));

            return(settings.ConnectionString.IfNullOrWhiteSpace(options.GetConnectionString(settings.ConnectionName)));
        }
Exemplo n.º 2
0
        public static bool IncludeBuiltinEntities(this DbOptions options, Type dbContextType)
        {
            var settings = options.DbContextSettings.GetOrDefault(dbContextType, () => DbContextSettings.CreateDefault(options.DefaultConnectionName));

            return(settings.IncludeServiceEntities);
        }
Exemplo n.º 3
0
        public static IDbProvider GetDbProvider(this DbOptions options, Type dbContextType)
        {
            var settings = options.DbContextSettings.GetOrDefault(dbContextType, () => DbContextSettings.CreateDefault(options.DefaultConnectionName));

            return(settings.DbProvider);
        }
Exemplo n.º 4
0
        public static bool IsDefaultContext(this DbOptions options, Type dbContextType)
        {
            var settings = options.DbContextSettings.GetOrDefault(dbContextType, () => DbContextSettings.CreateDefault(options.DefaultConnectionName));

            return(settings.IsDefault);
        }
Exemplo n.º 5
0
        public static IEnumerable <String> GetTablesForChecking(this DbOptions options, Type dbContextType)
        {
            var settings = options.DbContextSettings.GetOrDefault(dbContextType, () => DbContextSettings.CreateDefault(options.DefaultConnectionName));

            return(settings.TablesForCheckingDatabaseExists);
        }
Exemplo n.º 6
0
        public static String GetMigrationAssembly(this DbOptions options, Type dbContextType)
        {
            var settings = options.DbContextSettings.GetOrDefault(dbContextType, () => DbContextSettings.CreateDefault(options.DefaultConnectionName));

            return(settings.MigrationAssembly.IfNullOrWhiteSpace(dbContextType.GetTypeInfo().Assembly.FullName));
        }