Exemplo n.º 1
0
 public ClientRepository(
     odMineContractingContext dbContext,
     IMapper mapper)
 {
     this.dbContext = dbContext;
     this.mapper    = mapper;
 }
Exemplo n.º 2
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, odMineContractingContext dbContext)
        {
            dbContext.Database.Migrate();

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseHttpsRedirection();

            app.UseRouting();

            app.UseCors("AllowAnyOrigin");

            app.UseAuthorization();

            app.UseSwagger();
            app.UseSwaggerUI(
                c =>
            {
                c.SwaggerEndpoint("/swagger/v1/swagger.json", "od Mine Contracting API");
            });

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
            });
        }