// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, GrubNowDbContext ctx, UserManager <AppUser> userManager, RoleManager <AppRole> roleManager) { //Add Cors and Ogiins From request To acces Date List <string> origins = new List <string> { "http://localhost:4200", "https://localhost:4200" }; app.UseCors(options => options .WithOrigins(origins.ToArray()) .AllowAnyMethod().AllowCredentials().AllowAnyHeader().SetIsOriginAllowed((host) => true)); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseHttpsRedirection(); //Use Swagger //app.UseSwagger(); ////Use Swagger UI //app.UseSwaggerUI(c => //{ // c.SwaggerEndpoint("/swagger/v1/swagger.json", "PLENUM Project V1"); //}); app.UseRouting(); // Add Athentication And Authorizationm app.UseAuthentication(); app.UseAuthorization(); app.UseHttpsRedirection(); app.UseResponseCompression(); app.UseStaticFiles(); app.UseCookiePolicy(); //Used for logging using ILogger and SeriLog //var t = Configuration["Environment"]; //if (Configuration["Environment"] == "Local" || Configuration["Environment"] == "Dev") //{ // app.UseMiddleware(typeof(ErrorHandlingMiddleware)); //} app.UseEndpoints(endpoints => { endpoints.MapControllers(); //Use SignalR In Core 3.0.0 endpoints.MapHub <SignalRHub>(Configuration.GetSection("SignalRPath").Value); }); // DbInitializer.Initialize(ctx, userManager, roleManager); app.UseOpenApi(); app.UseSwaggerUi3(); app.UseReDoc(); // serve ReDoc UI }
public CategoryBL(IServiceProvider serviceProvider) : base(serviceProvider) { _BusinessBase = new BusinessBase <Category>(serviceProvider); _context = serviceProvider.GetRequiredService <GrubNowDbContext>(); }
public BlogBL(IServiceProvider serviceProvider) : base(serviceProvider) { _BusinessBase = new BusinessBase <Blogs>(serviceProvider); response = new BaseResponse(); _context = serviceProvider.GetRequiredService <GrubNowDbContext>(); }
public ListOfAllDataReposity(GrubNowDbContext context) { _context = context; }
public BusinessBase(IServiceProvider serviceProvider) { _serviceProvider = serviceProvider; plenumDbContext = serviceProvider.GetRequiredService <GrubNowDbContext>(); repositoryBase = new RepositoryBase <T>(serviceProvider); }
public RepositoryBase(IServiceProvider serviceProvider) { _context = serviceProvider.GetService <GrubNowDbContext>(); }
public EfRepository(GrubNowDbContext context) { _context = context; }