示例#1
0
        private DbContextOptionsBuilder <NieuweStroomPocDbContext> GetContextBuilderOptions <T>(string connectionStringName)
        {
            var connectionString   = ConfigurationSingleton.GetConfiguration().GetConnectionString(connectionStringName);
            var contextBuilder     = new DbContextOptionsBuilder <NieuweStroomPocDbContext>();
            var servicesCollection = new ServiceCollection().AddEntityFrameworkSqlServer().BuildServiceProvider();

            contextBuilder.UseSqlServer(connectionString).UseInternalServiceProvider(servicesCollection);

            return(contextBuilder);
        }
示例#2
0
        public Request()
        {
            var webHostBuilder = new WebHostBuilder().UseStartup <TStartup>().UseConfiguration(ConfigurationSingleton.GetConfiguration());

            this.server = new TestServer(webHostBuilder);
            this.client = server.CreateClient();
        }