예제 #1
0
        // 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
        }
예제 #2
0
 public CategoryBL(IServiceProvider serviceProvider) : base(serviceProvider)
 {
     _BusinessBase = new BusinessBase <Category>(serviceProvider);
     _context      = serviceProvider.GetRequiredService <GrubNowDbContext>();
 }
예제 #3
0
파일: BlogBL.cs 프로젝트: gabod2000/grubNow
 public BlogBL(IServiceProvider serviceProvider) : base(serviceProvider)
 {
     _BusinessBase = new BusinessBase <Blogs>(serviceProvider);
     response      = new BaseResponse();
     _context      = serviceProvider.GetRequiredService <GrubNowDbContext>();
 }
예제 #4
0
 public ListOfAllDataReposity(GrubNowDbContext context)
 {
     _context = context;
 }
예제 #5
0
 public BusinessBase(IServiceProvider serviceProvider)
 {
     _serviceProvider = serviceProvider;
     plenumDbContext  = serviceProvider.GetRequiredService <GrubNowDbContext>();
     repositoryBase   = new RepositoryBase <T>(serviceProvider);
 }
예제 #6
0
 public RepositoryBase(IServiceProvider serviceProvider)
 {
     _context = serviceProvider.GetService <GrubNowDbContext>();
 }
예제 #7
0
 public EfRepository(GrubNowDbContext context)
 {
     _context = context;
 }