// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, AspDotNetCoreDBContext db) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); app.UseSwagger(); app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", "MyAPI v1")); } //Database Create db.Database.EnsureCreated(); app.UseHttpsRedirection(); app.UseCors(x => x .AllowAnyOrigin() .AllowAnyMethod() .AllowAnyHeader()); app.UseAuthentication(); app.UseRouting(); app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); }
public EmployeeService(AspDotNetCoreDBContext db, IMapper mapper) { _db = db; _mapper = mapper; }
public AuthService(AspDotNetCoreDBContext context) { _context = context; }