void Awake () { if (reference == null) { reference = this; DontDestroyOnLoad (gameObject); JournalQuestsDatabase.reference = journalQuestsDatabase; Debug.Log("JournalQuestsDatabase initialized"); ItemDatabase.reference = itemDatabase; foreach(InventoryItem item in ItemDatabase.reference.items) { item.databaseIndex = ItemDatabase.reference.GetIndexOf(item); } Debug.Log("ItemDatabase initialized"); WorldTowns.reference = townsDatabase; Debug.Log("TownsDatabase initialized"); WorldWaystations.reference = waystationsDatabase; Debug.Log("WaystationsDatabase initialized"); } else { Destroy(gameObject); } }
public void Setup() { mDbName = "TestDatabaseInitializer.sdf"; File.Copy(@"..\EmptyDb.sdf", mDbName); mSession = DbAccess.GetSessionForEmptyDatabase(mDbName); mDatabaseInitializer = new DatabaseInitializer(mSession, null); }
private static void DatabaseInitialize() { // string file = HttpContext.Current.Server.MapPath("bin/Innocellence.CA.Service.dll"); // Assembly assembly = Assembly.LoadFrom(file); var Asss = AppDomain.CurrentDomain.GetAssemblies().Where(a => a.FullName.Contains("Innocellence") || a.FullName.Contains("Infrastructure")); foreach (var ass in Asss) { DatabaseInitializer.AddMapperAssembly(ass); } foreach (var ass in PluginManager.ReferencedPlugins) { if (ass.IsEnabled) { DatabaseInitializer.AddMapperAssembly(ass.ReferencedAssembly); } } DatabaseInitializer.Initialize(); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, EntityContext entityContext) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); app.UseBrowserLink(); } else { app.UseExceptionHandler("/Home/Error"); } app.UseStaticFiles(); DatabaseInitializer.InitializeDatabase(entityContext); app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller=Home}/{action=Index}/{id?}"); }); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseHsts(); } // Start Identity Setup DatabaseInitializer.Initialize(app); app.UseHttpsRedirection(); app.UseRouting(); app.UseCors(option => option .AllowAnyOrigin() .AllowAnyMethod() .AllowAnyHeader()); app.UseAuthentication(); app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); // Enable swagger middleware app.UseSwagger(); app.UseSwaggerUI(_ => { _.SwaggerEndpoint( $"/swagger/{_metadata.Version}/swagger.json", _metadata.Title); }); }
public static async Task Main(string[] args) { var host = CreateWebHostBuilder(args).Build(); using (var scope = host.Services.CreateScope()) { var services = scope.ServiceProvider; try { var context = services.GetRequiredService <AppDbContext>(); var initializer = new DatabaseInitializer(context); await initializer.InitializeCompany(); } catch (Exception ex) { var logger = services.GetRequiredService <ILogger <Program> >(); logger.LogError(ex, "An error occurred while seeding the database."); } } host.Run(); }
public static void Main(string[] args) { var host = CreateWebHostBuilder(args).Build(); using (var scope = host.Services.CreateScope()) { var services = scope.ServiceProvider; try { var context = services.GetRequiredService <SchoolTripPlannerContext>(); DatabaseInitializer.Initialize(context); } catch (Exception ex) { var logger = services.GetRequiredService <ILogger <Program> >(); logger.LogError(ex, "An error occurred creating the DB."); } } host.Run(); }
public async Task OnGetAsync_PopulatesThePageModel_WithAListOfResources() { // Arrange var optionsBuilder = new DbContextOptionsBuilder <ClippyContext>() .UseInMemoryDatabase("InMemoryDb"); var mockContext = new Mock <ClippyContext>(optionsBuilder.Options); var expectedResources = DatabaseInitializer.GetSeedingResources(); mockContext.Setup( db => db.GetResourcesAsync()).Returns(Task.FromResult(expectedResources)); var pageModel = new IndexModel(mockContext.Object); // Act await pageModel.OnGetAsync(); // Assert var actualResources = Assert.IsAssignableFrom <List <Resource> >(pageModel.Resources); Assert.Equal( expectedResources.OrderBy(r => r.Id).Select(r => r.Location), actualResources.OrderBy(r => r.Id).Select(r => r.Location)); }
public static void Main(string[] args) { var host = CreateWebHostBuilder(args).Build(); using (var scope = host.Services.CreateScope()) { try { var context = scope.ServiceProvider.GetService <DatabaseContext>(); context.Database.Migrate(); DatabaseInitializer.Initialize(context); } catch (Exception ex) { var logger = scope.ServiceProvider.GetRequiredService <ILogger <Program> >(); logger.LogError(ex, "An error occurred while migrating or initializing the database."); } } host.Run(); }
// https://docs.microsoft.com/en-us/aspnet/core/migration/1x-to-2x/#move-database-initialization-code public static void Main(string[] args) { var host = BuildWebHost(args); using (var scope = host.Services.CreateScope()) { var services = scope.ServiceProvider; try { DatabaseInitializer.Seed(services); } catch (Exception ex) { var logger = services.GetRequiredService <ILogger <Program> >(); logger.LogError(ex, "An error occurred while seeding the database."); //throw ex; } } host.Run(); }
public async Task OnGetAsync_PopulatesThePageModel_WithAUser(int userId) { // Arrange var optionsBuilder = new DbContextOptionsBuilder <ClippyContext>() .UseInMemoryDatabase("InMemoryDb"); var mockContext = new Mock <ClippyContext>(optionsBuilder.Options); var mockLogger = new Mock <ILogger <EditModel> >(); var expectedUser = DatabaseInitializer.GetSeedingUsers().Single(u => u.Id == userId); expectedUser.Roles = new List <Role>(); mockContext.Setup( db => db.GetUserAsync(userId)).Returns(Task.FromResult(expectedUser)); var pageModel = new EditModel(mockContext.Object, mockLogger.Object); // Act await pageModel.OnGetAsync(userId); // Assert var actualUser = Assert.IsAssignableFrom <EditUserModel>(pageModel.UserEntity); Assert.Equal(expectedUser.Username, actualUser.Username); }
public static void Main(string[] args) { var host = CreateHostBuilder(args).Build(); using (var scope = host.Services.CreateScope()) { var services = scope.ServiceProvider; var roomService = scope.ServiceProvider.GetService <RoomService>(); try { DatabaseInitializer.Seed(roomService); } catch (Exception ex) { var logger = services.GetRequiredService <ILogger <Program> >(); logger.LogError(ex, "An error occurred while seeding the database."); } } host.Run(); }
public async Task OnPostAsync_ReturnsAPageResult_WhenResourceLocationExists(int id, string existingLocation) { // Arrange var optionsBuilder = new DbContextOptionsBuilder <ClippyContext>() .UseInMemoryDatabase("InMemoryDb"); var mockContext = new Mock <ClippyContext>(optionsBuilder.Options); var idResource = DatabaseInitializer.GetSeedingResources().Single(r => r.Id == id); var locationResource = DatabaseInitializer.GetSeedingResources().Single(r => r.Location == existingLocation); mockContext.Setup(db => db.GetResourceAsync(id)).Returns(Task.FromResult(idResource)); mockContext.Setup(db => db.GetResourceByLocationAsync(existingLocation)).Returns(Task.FromResult(locationResource)); var httpContext = new DefaultHttpContext(); var modelState = new ModelStateDictionary(); var actionContext = new ActionContext(httpContext, new RouteData(), new PageActionDescriptor(), modelState); var modelMetadataProvider = new EmptyModelMetadataProvider(); var viewData = new ViewDataDictionary(modelMetadataProvider, modelState); var tempData = new TempDataDictionary(httpContext, Mock.Of <ITempDataProvider>()); var pageContext = new PageContext(actionContext) { ViewData = viewData }; var pageModel = new EditModel(mockContext.Object) { PageContext = pageContext, TempData = tempData, Url = new UrlHelper(actionContext), Resource = new EditResourceModel { Title = "1234567890", Location = existingLocation } }; // Act var result = await pageModel.OnPostAsync(id); // Assert Assert.IsType <PageResult>(result); }
public void ConfigureServices(IServiceCollection services) { services.AddControllers(); services.AddSwaggerGen(c => { c.SwaggerDoc("v1", new OpenApiInfo { Title = "CosmosLibraryApi", Version = "v1" }); }); // set the Emulator or Azure account var cosmosDBSettings = Configuration.GetSection("CosmosDbEmulator").Get <CosmosSettings>(); // cosmos db services try { services.AddSingleton <ICosmosService <Book> >(DatabaseInitializer.Initialize <Book>(cosmosDBSettings).GetAwaiter().GetResult()); services.AddSingleton <ICosmosService <Student> >(DatabaseInitializer.Initialize <Student>(cosmosDBSettings).GetAwaiter().GetResult()); } catch { Console.WriteLine($"Fatal Exception: Cosmos DB service is not ready"); } }
public void InitializeUsersTest() { var users = new List <User> { new User { Id = Guid.NewGuid(), FirstName = "test1" }, new User { Id = Guid.NewGuid(), FirstName = "test2" } }; var tasks = new List <Task> { new Task { Id = Guid.NewGuid(), Name = "test1" }, new Task { Id = Guid.NewGuid(), Name = "test2" } }; var mockUserInit = new Mock <IDatabaseUsersInitializer>(); mockUserInit.Setup(x => x.Initialize()).Returns(users); var mockTaskInit = new Mock <IDatabaseTasksInitializer>(); mockTaskInit.Setup(x => x.Initialize(users)).Returns(tasks); var initializer = new DatabaseInitializer(mockTaskInit.Object, mockUserInit.Object); var result = initializer.InitializeUsers(); Assert.AreEqual(users, result); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, UserManager <User> userManager, RoleManager <IdentityRole> roleManager, DatabaseContext context) { app.Use(async(ctx, next) => { await next(); if (ctx.Response.StatusCode == 204) { ctx.Response.ContentLength = 0; } }); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts(); } app.UseSwagger(); app.UseSwaggerUI(c => { c.SwaggerEndpoint("/swagger/v1/swagger.json", "TicketingSystem API V1"); c.RoutePrefix = string.Empty; }); app.UseCors(builder => builder.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader()); app.UseHttpsRedirection(); app.UseAuthentication(); app.UseMvc(); DatabaseInitializer.Initialize(userManager, roleManager, context).Wait(); }
public async Task OnPostAsync_ReturnsAPageResult_WhenModelStateIsInvalid() { // Arrange var optionsBuilder = new DbContextOptionsBuilder <ClippyContext>() .UseInMemoryDatabase("InMemoryDb"); var mockContext = new Mock <ClippyContext>(optionsBuilder.Options); var mockLogger = new Mock <ILogger <AddModel> >(); var expectedUsers = DatabaseInitializer.GetSeedingUsers(); mockContext.Setup(db => db.GetUsersAsync()).Returns(Task.FromResult(expectedUsers)); // mockLogger.Setup(l => l.LogWarning(AdminLoggingEvents.AddUserEvent, )) var httpContext = new DefaultHttpContext(); var modelState = new ModelStateDictionary(); var actionContext = new ActionContext(httpContext, new RouteData(), new PageActionDescriptor(), modelState); var modelMetadataProvider = new EmptyModelMetadataProvider(); var viewData = new ViewDataDictionary(modelMetadataProvider, modelState); var tempData = new TempDataDictionary(httpContext, Mock.Of <ITempDataProvider>()); var pageContext = new PageContext(actionContext) { ViewData = viewData }; var pageModel = new AddModel(mockContext.Object, mockLogger.Object) { PageContext = pageContext, TempData = tempData, Url = new UrlHelper(actionContext) }; pageModel.ModelState.AddModelError("Username", "Username is required."); // Act var result = await pageModel.OnPostAsync(); // Assert Assert.IsType <PageResult>(result); }
public async Task OnPostAsync_ReturnsAPageResult_WhenUsernameExists(string existingUsername) { // Arrange var optionsBuilder = new DbContextOptionsBuilder <ClippyContext>() .UseInMemoryDatabase("InMemoryDb"); var mockContext = new Mock <ClippyContext>(optionsBuilder.Options); var mockLogger = new Mock <ILogger <AddModel> >(); var existingUser = DatabaseInitializer.GetSeedingUsers().Single(u => u.Username == existingUsername); mockContext.Setup(db => db.GetUserByUsernameAsync(existingUsername)).Returns(Task.FromResult(existingUser)); var httpContext = new DefaultHttpContext(); var modelState = new ModelStateDictionary(); var actionContext = new ActionContext(httpContext, new RouteData(), new PageActionDescriptor(), modelState); var modelMetadataProvider = new EmptyModelMetadataProvider(); var viewData = new ViewDataDictionary(modelMetadataProvider, modelState); var tempData = new TempDataDictionary(httpContext, Mock.Of <ITempDataProvider>()); var pageContext = new PageContext(actionContext) { ViewData = viewData }; var pageModel = new AddModel(mockContext.Object, mockLogger.Object) { PageContext = pageContext, TempData = tempData, Url = new UrlHelper(actionContext), UserEntity = new AddUserModel { Username = existingUsername, Name = existingUser.Name } }; // Act var result = await pageModel.OnPostAsync(); // Assert Assert.IsType <PageResult>(result); }
public async Task OnPostDeleteAsync_ReturnsARedirectToPageResult(int bookmarkId) { // Arrange var optionsBuilder = new DbContextOptionsBuilder <ClippyContext>() .UseInMemoryDatabase("InMemoryDb"); var mockContext = new Mock <ClippyContext>(optionsBuilder.Options); var expectedBookmark = DatabaseInitializer.GetSeedingBookmarks().Single(b => b.Id == bookmarkId); mockContext.Setup( db => db.GetBookmarkAsync(bookmarkId)).Returns(Task.FromResult(expectedBookmark)); var httpContext = new DefaultHttpContext(); var tempData = new TempDataDictionary(httpContext, Mock.Of <ITempDataProvider>()); var pageModel = new DetailsModel(mockContext.Object) { TempData = tempData }; // Act var result = await pageModel.OnPostDeleteAsync(bookmarkId); // Assert Assert.IsType <RedirectToPageResult>(result); }
protected void Application_Start() { RouteTable.Routes.RouteExistingFiles = true;//让所有从客户端发送到iis的HTTP请求全部都要经过UrlRoutingModule模块进行路由规则判断的话 ViewEngines.Engines.Clear(); ViewEngines.Engines.Add(new RazorViewEngine()); ViewEngines.Engines.Add(new WebFormViewEngine()); AreaRegistration.RegisterAllAreas(); WebApiConfig.Register(GlobalConfiguration.Configuration); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); //autofac注册 RegisterAutofacForSingle.RegisterAutofac(); //数据库初始化设置 DatabaseInitializer.Initialize(); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, UserManager <User> userManager, RoleManager <IdentityRole> roleManager) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseRouting(); app.UseAuthentication(); app.UseAuthorization(); DatabaseInitializer.SeedData(userManager, roleManager); app.UseEndpoints(endpoints => { endpoints.MapControllerRoute( name: "default", pattern: "{controller=Home}/{action=Index}/{id?}"); }); }
// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddDistributedMemoryCache(); services.AddSession(options => { options.IdleTimeout = TimeSpan.FromHours(10); options.Cookie.HttpOnly = true; options.Cookie.IsEssential = true; }); services.AddControllers().AddNewtonsoftJson(options => options.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore); services.AddCors(option => option.AddPolicy("cors", policy => policy.AllowAnyHeader().AllowAnyMethod().AllowAnyOrigin())); using var db = new Context(); //db.Database.EnsureDeleted(); //db.Database.EnsureCreated(); //if(!db.Users.Any()) //{ // //PublicBicyclesDatabaseInitializer.GenerateTestDatas(db); //} DatabaseInitializer.Initialize(db); }
public static void Main(string[] args) { var host = CreateWebHostBuilder(args).Build(); using (var scope = host.Services.CreateScope()) { var services = scope.ServiceProvider; try { var northwindContext = services.GetRequiredService <NorthwindContext>(); var masterContext = services.GetRequiredService <MasterContext>(); DatabaseInitializer.SeedData(northwindContext, masterContext); } catch (Exception ex) { Debug.WriteLine(ex); } } host.Run(); }
public static void Main(string[] args) { IWebHost host = BuildWebHost(args); using (IServiceScope scope = host.Services.CreateScope()) { IServiceProvider services = scope.ServiceProvider; DeliveryServiceContext context = services.GetRequiredService <DeliveryServiceContext>(); try { DatabaseInitializer.Seed(services); } catch (Exception ex) { ILogger <Program> logger = services.GetRequiredService <ILogger <Program> >(); logger.LogError(ex, "An error occurred on seeding in the memory database."); } } host.Run(); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseSerilogRequestLogging(); DatabaseInitializer.Initialize(app, Configuration); app.UseIdentityServer(); app.UseHttpsRedirection(); app.UseRouting(); app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(Microsoft.AspNetCore.Builder.IApplicationBuilder app, IHostingEnvironment env, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory) { loggerFactory.AddConsole(Configuration.GetSection("Logging")); loggerFactory.AddDebug(); app.UseStaticFiles(); app.UseIdentity(); // Add external authentication middleware below. To configure them please see http://go.microsoft.com/fwlink/?LinkID=532715 app.UseSession(); app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller=Home}/{action=Index}/{id?}"); }); app.UseStatusCodePagesWithRedirects("Account/AccessDenied"); DatabaseInitializer.Initialize(app.ApplicationServices); }
static void Main(string[] args) { var options = new DbContextOptionsBuilder <DatabaseContext>() .UseInMemoryDatabase(databaseName: "Sample_Data") .Options; // Insert test data in the DB using (var context = new DatabaseContext(options)) { var intiliazer = new DatabaseInitializer(); intiliazer.Initialize(context); } using (var context = new DatabaseContext(options)) { //You can erase the following 3 lines if needed context.Cities.ForEachAsync(c => Console.WriteLine(c.Name)); context.Departments.ForEachAsync(d => Console.WriteLine(d.Name)); context.Employees.ForEachAsync(e => Console.WriteLine($"{e.FirstName} {e.LastName}")); //1. List all employees whose department has an office in Chihuahua //2. List all departments and the number of employees that belong to each department. //3. List all remote employees. That is all employees whose living city is not in the list of cities of their department's. //4. List all employees whose hire anniversary is next month. //5. List all 12 months of the year and the number of employees hired on each month. } Console.ReadLine(); }
/// <summary> /// Configure the application /// </summary> /// <param name="app">The application builder</param> /// <param name="env">The current hosting environment details</param> /// <param name="loggerFactory">The logger factory</param> public void Configure( IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)/*, * IServiceCollection services)*/ { // Initialise logging loggerFactory.AddConsole(this.Configuration.GetSection("Logging")); loggerFactory.AddDebug(); // Setup database configuration DatabaseInitializer.Initialize(); // Setup any other global configuration objects that implement IGlobalConfiguration GlobalConfigurator.Configure(); // Specify error message display if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler("/Home/Error"); } // Bind application configuration from json appsettings.json var config = this.Configuration; var appConfig = new AppConfiguration(); ConfigurationBinder.Bind(config, appConfig); // Wire up nancy app.UseOwin(x => x.UseNancy(opt => opt.Bootstrapper = new NancyBootstrapper())); }
public static void Main(string[] args) { //DB Seeder var host = CreateWebHostBuilder(args).Build(); using (var scope = host.Services.CreateScope()) { var services = scope.ServiceProvider; try { var context = services.GetRequiredService <DatabaseContext>(); DatabaseInitializer.InitializeIncidents(context); DatabaseInitializer.InitializeUserAccounts(context); } catch (Exception ex) { throw ex; //we could log this in a real-world situation } } host.Run(); //CreateWebHostBuilder(args).Build().Run(); }
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, UserManager <User> userManager, RoleManager <IdentityRole> roleManager) { loggerFactory.AddConsole(Configuration.GetSection("Logging")); loggerFactory.AddDebug(); app.UseDefaultFiles(); app.UseStaticFiles(); if (env.IsDevelopment()) { app.UseBrowserLink(); app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler("/Error"); } app.UseAuthentication(); app.UseMvc(); DatabaseInitializer.SeedIdentityItems(userManager, roleManager).Wait(); DatabaseInitializer.InitializeData(app.ApplicationServices).Wait(); app.UseExceptionHandler(); }
public async Task DbInitAsync_NoDb_Test() { #region Stubs var current = (Version)null; var mandatory = new Version(1, 0); var migrationPatterns = new Tuple <Version, Version> [0]; #endregion #region Mocks var dbInitializerDal = new Mock <IDbInitializerDal>(MockBehavior.Strict); dbInitializerDal .Setup(x => x.GetCurrentDbVersionAsync()) .ReturnsAsync(current); dbInitializerDal .Setup(x => x.GetMandatoryDbVersion()) .Returns(mandatory); dbInitializerDal .Setup(x => x.InitDbAsync()) .ReturnsAsync(new Version(1, 0)); dbInitializerDal .Setup(x => x.GetMigrationPatterns()) .Returns(migrationPatterns); #endregion var dbInitializer = new DatabaseInitializer(dbInitializerDal.Object); await dbInitializer.InitAndMigrateDbAsync(); #region Validations dbInitializerDal.VerifyAll(); #endregion }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, WeatherAppDbContext dbContext) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler("/Home/Error"); app.UseHsts(); } app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseCookiePolicy(); DatabaseInitializer.Initialize(dbContext); app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller=Home}/{action=Index}/{id?}"); }); }
/// <summary> /// 初始化一个<see cref="MvcFrameworkInitializer"/>类型的新实例 /// </summary> public MvcFrameworkInitializer() { PlatformToken = PlatformToken.Mvc; DataConfigReseter = new DataConfigReseter(); DatabaseInitializer = new DatabaseInitializer(); }
/// <summary> /// 初始化一个<see cref="MvcFrameworkInitializer"/>类型的新实例 /// </summary> public MvcFrameworkInitializer() { PlatformToken = PlatformToken.Mvc; DataConfigReseter = new DataConfigReseter<OJavaDbContext, OJavaDbContextInitializer>(); DatabaseInitializer = new DatabaseInitializer<OJavaDbContext, OJavaDbContextInitializer>(); }