Example #1
0
        private static DbContextPool <SchemaContext> CreatePool(DbContextOptions <DynamicDbContext> dynamicDbContextOptions)
        {
            var optionsBuilder = new DbContextOptionsBuilder <SchemaContext>();

            optionsBuilder.ReplaceService <IModelCustomizer, PostgreSqlModelCustomizer>();

            DbContextOptions schemaOptions = optionsBuilder.CreateOptions(dynamicDbContextOptions);

            return(new DbContextPool <SchemaContext>(schemaOptions));
        }
Example #2
0
        private static DbContextPool <SchemaContext> CreatePool(DbContextOptions <DynamicDbContext> dynamicDbContextOptions)
        {
            var optionsBuilder = new DbContextOptionsBuilder <SchemaContext>();

            optionsBuilder.ReplaceService <IModelCustomizer, MySqlModelCustomizer>();
            optionsBuilder.ReplaceService <IEntityMaterializerSource, MySqlModelCustomizer.MySqlEntityMaterializerSource>();

            var schemaOptions = (DbContextOptions <SchemaContext>)optionsBuilder.CreateOptions(dynamicDbContextOptions);

            return(new DbContextPool <SchemaContext>(schemaOptions));
        }