Example #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)));
        }
Example #2
0
        public static bool IncludeBuiltinEntities(this DbOptions options, Type dbContextType)
        {
            var settings = options.DbContextSettings.GetOrDefault(dbContextType, () => DbContextSettings.CreateDefault(options.DefaultConnectionName));

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

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

            return(settings.IsDefault);
        }
Example #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);
        }
Example #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));
        }