Пример #1
0
        // 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();
        }
Пример #2
0
        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);
        }
Пример #3
0
        // 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();
            });
        }
Пример #4
0
 public CaminhaoRepository(VolvoContext context) : base(context)
 {
     Context = context;
 }
Пример #5
0
 public CaminhoesService(VolvoContext context)
 {
     _context = context;
 }
Пример #6
0
 public BaseRepository(VolvoContext context)
 {
     _context = context;
 }
Пример #7
0
 public ModeloRepository(IConfiguration configuration, VolvoContext context)
 {
     _context       = context;
     _configuration = configuration;
 }
Пример #8
0
 public StatusRepository(VolvoContext context) : base(context)
 {
     Context = context;
 }
Пример #9
0
 public CaminhaoRepository(IConfiguration configuration, VolvoContext context)
 {
     _context       = context;
     _configuration = configuration;
 }