public LocalCoreDbContext CreateDbContext(string[] args)
        {
            var builder = new DbContextOptionsBuilder <LocalCoreDbContext>();

            //var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder());

            MyDocumentManageDbContextConfigurer.Configure(builder, AppConfigurtaionServices.GetAppSettings()["ConnectionStrings:mydb"]);

            return(new LocalCoreDbContext());
        }
Пример #2
0
        public DbContextOptions <LocalCoreDbContext> GetDbContextOption()
        {
            var builder = new DbContextOptionsBuilder <LocalCoreDbContext>();

            //var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder());

            //MyDocumentManageDbContextConfigurer.Configure(builder, configuration.GetConnectionString("mydb"));

            MyDocumentManageDbContextConfigurer.Configure(builder, AppConfigurtaionServices.GetAppSettings()["ConnectionStrings:mydb"]);
            return(builder.Options);
        }