Пример #1
0
 public ServissRepository(
     IOptions <AppSettings> settings,
     AutoServissDbContext context,
     IMemoryCache memoryCache)
 {
     _settings    = settings.Value;
     _context     = context;
     _memoryCache = memoryCache;
 }
Пример #2
0
 public KlientiRepository(
     IOptions <AppSettings> settings,
     IMemoryCache memoryCache,
     AutoServissDbContext context)
 {
     _settings    = settings.Value;
     _memoryCache = memoryCache;
     _context     = context;
 }
Пример #3
0
 public StatussRepository(AutoServissDbContext context, IMemoryCache memoryCache)
 {
     _context     = context;
     _memoryCache = memoryCache;
 }
Пример #4
0
 public AuthService(IOptions <AppSettings> settings, AutoServissDbContext context)
 {
     _settings = settings.Value;
     _context  = context;
 }
Пример #5
0
        public void Configure(IApplicationBuilder app, IOptions <AppSettings> settings, AutoServissDbContext dbContext)
        {
            app.UseMiddleware(typeof(CustomExceptionHandlerMiddleware));

            if (_env.IsDevelopment())
            {
                app.UseCors(policy =>
                {
                    policy.AllowAnyOrigin();
                    policy.AllowCredentials();
                    policy.AllowAnyHeader();
                    policy.AllowAnyMethod();
                });
            }

            app.UseDefaultFiles();
            app.UseStaticFiles();

            //// nginx reverse-proxy, jābūt pirms UseAuthentication
            //app.UseForwardedHeaders(new ForwardedHeadersOptions
            //{
            //    ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto
            //});

            app.UseAuthentication();

            app.UseMvc();

            //SeedData.Initialize(dbContext, _env);
        }