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

            LilleDbContextConfigurer.Configure(builder, configuration.GetConnectionString(LilleConsts.ConnectionStringName));

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