Exemple #1
0
        public ABP_VUEDbContext CreateDbContext(string[] args)
        {
            var builder       = new DbContextOptionsBuilder <ABP_VUEDbContext>();
            var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder());

            ABP_VUEDbContextConfigurer.Configure(builder, configuration.GetConnectionString(ABP_VUEConsts.ConnectionStringName));

            return(new ABP_VUEDbContext(builder.Options));
        }
Exemple #2
0
 public override void PreInitialize()
 {
     if (!SkipDbContextRegistration)
     {
         Configuration.Modules.AbpEfCore().AddDbContext <ABP_VUEDbContext>(options =>
         {
             if (options.ExistingConnection != null)
             {
                 ABP_VUEDbContextConfigurer.Configure(options.DbContextOptions, options.ExistingConnection);
             }
             else
             {
                 ABP_VUEDbContextConfigurer.Configure(options.DbContextOptions, options.ConnectionString);
             }
         });
     }
 }