public MicroserviceSampleDbContext CreateDbContext(string[] args)
        {
            var builder       = new DbContextOptionsBuilder <MicroserviceSampleDbContext>();
            var configuration = AppConfigurations.Get(AppDomain.CurrentDomain.BaseDirectory);

            MicroserviceSampleDbContextConfigurer.Configure(builder, configuration.GetConnectionString(SharedConsts.MicroserviceSampleConnectionStringName));

            return(new MicroserviceSampleDbContext(builder.Options));
        }
 public override void PreInitialize()
 {
     if (!SkipDbContextRegistration)
     {
         Configuration.Modules.AbpEfCore().AddDbContext <MicroserviceSampleDbContext>(options =>
         {
             if (options.ExistingConnection != null)
             {
                 MicroserviceSampleDbContextConfigurer.Configure(options.DbContextOptions, options.ExistingConnection);
             }
             else
             {
                 var connectionString = AppConfigurations.GetConnectionString(options.DbContextOptions.Options.ContextType.ToString());
                 MicroserviceSampleDbContextConfigurer.Configure(options.DbContextOptions, connectionString);
             }
         });
     }
 }