Beispiel #1
0
        public MygoalDbContext Create(DbContextFactoryOptions options)
        {
            var builder       = new DbContextOptionsBuilder <MygoalDbContext>();
            var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder());

            MygoalDbContextConfigurer.Configure(builder, configuration.GetConnectionString(MygoalConsts.ConnectionStringName));

            return(new MygoalDbContext(builder.Options));
        }
 public override void PreInitialize()
 {
     if (!SkipDbContextRegistration)
     {
         Configuration.Modules.AbpEfCore().AddDbContext <MygoalDbContext>(configuration =>
         {
             MygoalDbContextConfigurer.Configure(configuration.DbContextOptions, configuration.ConnectionString);
         });
     }
 }