Ejemplo n.º 1
0
        public MFDbContext CreateDbContext(string[] args)
        {
            var builder       = new DbContextOptionsBuilder <MFDbContext>();
            var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder());

            MFDbContextConfigurer.Configure(builder, configuration.GetConnectionString(MFConsts.ConnectionStringName));

            return(new MFDbContext(builder.Options));
        }
Ejemplo n.º 2
0
 public override void PreInitialize()
 {
     if (!SkipDbContextRegistration)
     {
         Configuration.Modules.AbpEfCore().AddDbContext <MFDbContext>(options =>
         {
             if (options.ExistingConnection != null)
             {
                 MFDbContextConfigurer.Configure(options.DbContextOptions, options.ExistingConnection);
             }
             else
             {
                 MFDbContextConfigurer.Configure(options.DbContextOptions, options.ConnectionString);
             }
         });
     }
 }