// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, VolvoContext context) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } InicializaDb.Initialize(context); app.UseMvc(); }
private bool disposedValue = false; // To detect redundant calls public VolvoContext CreateContextForInMemory() { var option = new DbContextOptionsBuilder <VolvoContext>().UseInMemoryDatabase(databaseName: $"VolvoDbInMemory").Options; var context = new VolvoContext(option); if (context != null) { context.Database.EnsureDeleted(); context.Database.EnsureCreated(); } return(context); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, VolvoContext volvoContext) { volvoContext.Database.Migrate(); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); app.UseSwagger(); app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", "Volvo.BFF v1")); } app.UseCors("MyPolicy"); app.UseRouting(); app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); }
public CaminhaoRepository(VolvoContext context) : base(context) { Context = context; }
public CaminhoesService(VolvoContext context) { _context = context; }
public BaseRepository(VolvoContext context) { _context = context; }
public ModeloRepository(IConfiguration configuration, VolvoContext context) { _context = context; _configuration = configuration; }
public StatusRepository(VolvoContext context) : base(context) { Context = context; }
public CaminhaoRepository(IConfiguration configuration, VolvoContext context) { _context = context; _configuration = configuration; }