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

            MicroserviceBaseProjectDbContextConfigurer.Configure(builder, configuration.GetConnectionString(SharedConsts.MicroserviceBaseProjectConnectionStringName));

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