public DotNetCoreWebApiProjectDbContext CreateDbContext(string[] args)
        {
            var builder       = new DbContextOptionsBuilder <DotNetCoreWebApiProjectDbContext>();
            var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder());

            DotNetCoreWebApiProjectDbContextConfigurer.Configure(builder, configuration.GetConnectionString(DotNetCoreWebApiProjectConsts.ConnectionStringName));

            return(new DotNetCoreWebApiProjectDbContext(builder.Options));
        }
Exemplo n.º 2
0
        public WardrobeCloudDbContext CreateDbContext(string[] args)
        {
            var builder       = new DbContextOptionsBuilder <WardrobeCloudDbContext>();
            var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder());

            WardrobeCloudDbContextConfigurer.Configure(builder, configuration.GetConnectionString(WardrobeCloudConsts.ConnectionStringName));

            return(new WardrobeCloudDbContext(builder.Options));
        }
        public GMSFrameworkDbContext CreateDbContext(string[] args)
        {
            var builder       = new DbContextOptionsBuilder <GMSFrameworkDbContext>();
            var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder());

            GMSFrameworkDbContextConfigurer.Configure(builder, configuration.GetConnectionString(GMSFrameworkConsts.ConnectionStringName));

            return(new GMSFrameworkDbContext(builder.Options));
        }
Exemplo n.º 4
0
        public CenterDbContext CreateDbContext(string[] args)
        {
            var builder       = new DbContextOptionsBuilder <CenterDbContext>();
            var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder(), addUserSecrets: true);

            CenterDbContextConfigurer.Configure(builder, configuration.GetConnectionString(CenterConsts.ConnectionStringName));

            return(new CenterDbContext(builder.Options));
        }
        public ABPEasyWebCreationDbContext CreateDbContext(string[] args)
        {
            var builder       = new DbContextOptionsBuilder <ABPEasyWebCreationDbContext>();
            var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder());

            ABPEasyWebCreationDbContextConfigurer.Configure(builder, configuration.GetConnectionString(ABPEasyWebCreationConsts.ConnectionStringName));

            return(new ABPEasyWebCreationDbContext(builder.Options));
        }
        public HorasComplementaresAppDbContext CreateDbContext(string[] args)
        {
            var builder       = new DbContextOptionsBuilder <HorasComplementaresAppDbContext>();
            var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder());

            HorasComplementaresAppDbContextConfigurer.Configure(builder, configuration.GetConnectionString(HorasComplementaresAppConsts.ConnectionStringName));

            return(new HorasComplementaresAppDbContext(builder.Options));
        }
        public SportsStoreCoreDbContext Create(DbContextFactoryOptions options)
        {
            var builder       = new DbContextOptionsBuilder <SportsStoreCoreDbContext>();
            var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder());

            SportsStoreCoreDbContextConfigurer.Configure(builder, configuration.GetConnectionString(SportsStoreCoreConsts.ConnectionStringName));

            return(new SportsStoreCoreDbContext(builder.Options));
        }
        public TimePlayZeroDbContext CreateDbContext(string[] args)
        {
            var builder       = new DbContextOptionsBuilder <TimePlayZeroDbContext>();
            var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder());

            TimePlayZeroDbContextConfigurer.Configure(builder, configuration.GetConnectionString(TimePlayZeroConsts.ConnectionStringName));

            return(new TimePlayZeroDbContext(builder.Options));
        }
Exemplo n.º 9
0
        public votingBackendDbContext Create(DbContextFactoryOptions options)
        {
            var builder       = new DbContextOptionsBuilder <votingBackendDbContext>();
            var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder());

            votingBackendDbContextConfigurer.Configure(builder, configuration.GetConnectionString(votingBackendConsts.ConnectionStringName));

            return(new votingBackendDbContext(builder.Options));
        }
Exemplo n.º 10
0
        public SettlementContext CreateDbContext(string[] args)
        {
            var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder(),
                                                      addUserSecrets: true);
            var builder = new DbContextOptionsBuilder <SettlementContext>()
                          .UseMySql(configuration.GetConnectionString("Master"));

            return(new SettlementContext(builder.Options, new NullMediator()));
        }
        public InfomationSystemDbContext CreateDbContext(string[] args)
        {
            var builder       = new DbContextOptionsBuilder <InfomationSystemDbContext>();
            var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder());

            InfomationSystemDbContextConfigurer.Configure(builder, configuration.GetConnectionString(InfomationSystemConsts.ConnectionStringName));

            return(new InfomationSystemDbContext(builder.Options));
        }
        public uvahoyDbContext CreateDbContext(string[] args)
        {
            var    builder       = new DbContextOptionsBuilder <uvahoyDbContext>();
            var    configuration = Configuration.AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder());
            string cnnString     = configuration.GetConnectionString(uvahoyConsts.ConnectionStringName);

            uvahoyDbContextConfigurer.Configure(builder, cnnString);

            return(new uvahoyDbContext(builder.Options));
        }
        public IEConfigurationDbContext CreateDbContext(string[] args)
        {
            var builder = new DbContextOptionsBuilder <IEConfigurationDbContext>();

            var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder());

            builder.UseSqlServer(configuration.GetConnectionString("IdentityServer"));

            return(new IEConfigurationDbContext(builder.Options));
        }
Exemplo n.º 14
0
        private static string GetConnectionString()
        {
            var configuration = AppConfigurations.Get(
                WebContentDirectoryFinder.CalculateContentRootFolder()
                );

            return(configuration.GetConnectionString(
                       "Default"
                       ));
        }
        public override string GetNameOrConnectionString(ConnectionStringResolveArgs args)
        {
            if (args["DbContextConcreteType"] as Type == typeof(AuditLogDbContext))
            {
                var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder());
                return(configuration.GetConnectionString(MetroStationConsts.AuditLogConnectionStringName));
            }

            return(base.GetNameOrConnectionString(args));
        }
        public override string GetNameOrConnectionString(ConnectionStringResolveArgs args)
        {
            if (args["DbContextConcreteType"] as Type == typeof(SecondDbContext))
            {
                var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder());
                return(configuration.GetConnectionString(MultipleDbContextEfCoreDemoConsts.SecondDbConnectionStringName));
            }

            return(base.GetNameOrConnectionString(args));
        }
Exemplo n.º 17
0
        private static string GetConnectionString()
        {
            var configuration = AppConfigurations.Get(
                WebContentDirectoryFinder.CalculateContentRootFolder()
                );

            return(configuration.GetConnectionString(
                       AbpZeroTemplateConsts.ConnectionStringName
                       ));
        }
Exemplo n.º 18
0
        public SharedFixture()
        {
            Configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder(), "development", addUserSecrets: true);
            PathProvider  = new PathProvider(Configuration);

            //Set the DataDirectory which is required by PathProvider
            string currentDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

            AppDomain.CurrentDomain.SetData("DataDirectory", Path.Combine(currentDirectory, "App_Data"));
        }
Exemplo n.º 19
0
        public QksPluginDbContext CreateDbContext(string[] args)
        {
            var builder       = new DbContextOptionsBuilder <QksPluginDbContext>();
            var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder());

            //可以在这里切换数据库
            QksPluginDbContextConfigurer.Configure(builder, configuration.GetConnectionString(QksConsts.ConnectionStringName));

            return(new QksPluginDbContext(builder.Options));
        }
Exemplo n.º 20
0
        public SecondDbContext CreateDbContext(string[] args)
        {
            var builder = new DbContextOptionsBuilder <SecondDbContext>();

            var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder());

            SecondDbContextConfigurer.Configure(builder, configuration.GetConnectionString(MultipleDataBaseConsts.MySqlConnectionStringName));

            return(new SecondDbContext(builder.Options));
        }
Exemplo n.º 21
0
        public MySqlDemoDbContext CreateDbContext(string[] args)
        {
            var builder = new DbContextOptionsBuilder <MySqlDemoDbContext>();

            var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder());

            MySqlDemoDbContextConfigurer.Configure(builder, configuration.GetConnectionString("Default2" /**TreeMisConsts.ConnectionStringName**/));

            //todo 初始化 DbContent
            return(new MySqlDemoDbContext(builder.Options));
        }
        /// <summary>
        /// 用反射创建DbContext实例
        /// </summary>
        /// <param name="args"></param>
        /// <returns></returns>
        public T CreateDbContext(string[] args)
        {
            var builder       = new DbContextOptionsBuilder <T>();
            var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder());

            MySqlDbContextConfigurer.Configure(
                builder,
                configuration.GetConnectionString(ConnectionStringName)
                );
            return((T)Activator.CreateInstance(typeof(T), new object[] { builder.Options }));
        }
        public override string GetNameOrConnectionString(ConnectionStringResolveArgs args)
        {
            var connectStringName = this.GetConnectionStringName(args);

            if (connectStringName != null)
            {
                var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder(), _env.EnvironmentName, _env.IsDevelopment());
                return(configuration.GetConnectionString(connectStringName));
            }
            return(base.GetNameOrConnectionString(args));
        }
        public T CreateDbContext(string[] args)
        {
            var builder       = new DbContextOptionsBuilder <T>();
            var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder());

            DbContextOptionsConfigurer.Configure(
                builder,
                configuration.GetConnectionString(ConnectionStringName)
                );
            return(this.CreateDbContext(builder.Options));
        }
Exemplo n.º 25
0
        public SecurityDbContext CreateDbContext(string[] args)
        {
            var optionsBuilder = new DbContextOptionsBuilder <SecurityDbContext>();

            var configuration = AppConfigurations.Get(
                WebContentDirectoryFinder.CalculateContentRootFolder());

            SecurityDbContextConfigurer.Configure(optionsBuilder, configuration.GetConnectionString("Sql"), configuration.GetValue <bool>("DbOption:UseSqlServer"));

            return(new SecurityDbContext(optionsBuilder.Options));
        }
        public BoilerplateExampleDbContext CreateDbContext(string[] args)
        {
            var builder       = new DbContextOptionsBuilder <BoilerplateExampleDbContext>();
            var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder());

            DbContextOptionsConfigurer.Configure(
                builder,
                configuration.GetConnectionString(BoilerplateExampleConsts.ConnectionStringName)
                );

            return(new BoilerplateExampleDbContext(builder.Options));
        }
Exemplo n.º 27
0
        public SDIMDbContext CreateDbContext(string[] args)
        {
            var builder       = new DbContextOptionsBuilder <SDIMDbContext>();
            var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder());

            SDIMDbContextOptionsConfigurer.Configure(
                builder,
                configuration.GetConnectionString(SMICConsts.SDIMConnectionStringName)
                );

            return(new SDIMDbContext(builder.Options));
        }
        public ISASDbContext CreateDbContext(string[] args)
        {
            var builder       = new DbContextOptionsBuilder <ISASDbContext>();
            var configuration = ISASConfiguration.Get(WebContentDirectoryFinder.CalculateContentRootFolder());

            DbContextOptionsConfigurer.Configure(
                builder,
                configuration.GetConnectionString(ISASConsts.ConnectionStringKey)
                );

            return(new ISASDbContext(builder.Options));
        }
        public AspNetBoilerPlate_Demo2DbContext CreateDbContext(string[] args)
        {
            var builder       = new DbContextOptionsBuilder <AspNetBoilerPlate_Demo2DbContext>();
            var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder());

            DbContextOptionsConfigurer.Configure(
                builder,
                configuration.GetConnectionString(AspNetBoilerPlate_Demo2Consts.ConnectionStringName)
                );

            return(new AspNetBoilerPlate_Demo2DbContext(builder.Options));
        }
Exemplo n.º 30
0
        public MultipleDbContextEfCoreDemoDbContext CreateDbContext(string[] args)
        {
            var builder       = new DbContextOptionsBuilder <MultipleDbContextEfCoreDemoDbContext>();
            var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder());

            DbContextOptionsConfigurer.Configure(
                builder,
                configuration.GetConnectionString(MultipleDbContextEfCoreDemoConsts.ConnectionStringName)
                );

            return(new MultipleDbContextEfCoreDemoDbContext(builder.Options));
        }