Exemplo n.º 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, ReactivitiesDbContext context, UserManager <AppUser> userManager)
        {
            //custom exception handling middleware
            app.UseMiddleware <ExceptionMiddleware>();

            //app.UseXContentTypeOptions();
            //app.UseReferrerPolicy(opt => opt.NoReferrer());
            //app.UseXXssProtection(opt => opt.EnabledWithBlockMode());
            //app.UseXfo(opt => opt.Deny());
            //app.UseCspReportOnly(opt => opt
            //    .BlockAllMixedContent()
            //    .StyleSources(s => s.Self())
            //    .FontSources(s => s.Self())
            //    .FormActions(s => s.Self())
            //    .FrameAncestors(s => s.Self())
            //    .ImageSources(s => s.Self())
            //    .ScriptSources(s => s.Self())
            //);

            if (env.IsDevelopment())
            {
                app.UseSwagger();
                app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", "ReactivitiesAPI v1"));
            }
            //else
            //{
            //    app.Use(async (context, next) =>
            //    {
            //        context.Response.Headers.Add("Strict-Transport-Security", "max-age-31536000");
            //        await next.Invoke();
            //    });
            //}

            app.UseHttpsRedirection();

            app.UseRouting();

            app.UseCors("CorsPolicy");

            app.UseAuthentication();
            app.UseAuthorization();

            DataSeeding.SeedData(context, userManager).Wait();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
                endpoints.MapHub <ChatHub>("/chat");
            });
        }
Exemplo n.º 2
0
 public DeletePhotoCommandHandler(ReactivitiesDbContext context, IUserAccessor userAccessor, IPhotoAccessor photoAccessor)
 {
     _context       = context;
     _userAccessor  = userAccessor;
     _photoAccessor = photoAccessor;
 }
Exemplo n.º 3
0
 public EditHandler(ReactivitiesDbContext context)
 {
     this.context = context;
 }
Exemplo n.º 4
0
 public Handler(ReactivitiesDbContext context, IMapper mapper, IUserAccessor userAccessor)
 {
     _context      = context;
     _mapper       = mapper;
     _userAccessor = userAccessor;
 }
Exemplo n.º 5
0
 public GetActivityDetailsQueryHandler(ReactivitiesDbContext context, IMapper mapper)
 {
     _context = context;
     _mapper  = mapper;
 }
Exemplo n.º 6
0
 public ProfileReader(IUserAccessor userAccessor, ReactivitiesDbContext context)
 {
     _userAccessor = userAccessor;
     _context      = context;
 }
Exemplo n.º 7
0
 public Handler(ReactivitiesDbContext context, IUserAccessor userAccessor)
 {
     _context      = context;
     _userAccessor = userAccessor;
 }
 public DeleteActivityCommandHandler(ReactivitiesDbContext context)
 {
     _context = context;
 }
 public IsHostRequirementHandler(IHttpContextAccessor httpContextAccessor, ReactivitiesDbContext context)
 {
     _httpContextAccessor = httpContextAccessor;
     _context             = context;
 }
 public CreateCommentCommandHandler(ReactivitiesDbContext context, IMapper mapper)
 {
     _context = context;
     _mapper  = mapper;
 }
Exemplo n.º 11
0
 public SetMainPhotoCommandHandler(ReactivitiesDbContext context, IUserAccessor userAccessor)
 {
     _context      = context;
     _userAccessor = userAccessor;
 }
Exemplo n.º 12
0
 public ValuesController(ReactivitiesDbContext context)
 {
     this.context = context;
 }
 public RegisterUserCommandHandler(UserManager <User> userManager, IJwtGenerator jwtGenerator, ReactivitiesDbContext context)
 {
     _userManager  = userManager;
     _jwtGenerator = jwtGenerator;
     _context      = context;
 }
Exemplo n.º 14
0
 public Handler(ReactivitiesDbContext context)
 {
     _context = context;
 }
 public GetFollowersQueryHandler(ReactivitiesDbContext context, IProfileReader profileReader)
 {
     _context       = context;
     _profileReader = profileReader;
 }
Exemplo n.º 16
0
 public AttendActivityCommandHandler(ReactivitiesDbContext context, IUserAccessor userAccessor)
 {
     _context      = context;
     _userAccessor = userAccessor;
 }
Exemplo n.º 17
0
 public IsHostRequirementHandler(ReactivitiesDbContext dbContext, IHttpContextAccessor httpContextAccessor)
 {
     _dbContext           = dbContext;
     _httpContextAccessor = httpContextAccessor;
 }
 public CreateFollowerCommandHandler(ReactivitiesDbContext context, IUserAccessor userAccessor)
 {
     _context      = context;
     _userAccessor = userAccessor;
 }
Exemplo n.º 19
0
 public DeleteHandler(ReactivitiesDbContext context)
 {
     this.context = context;
 }
Exemplo n.º 20
0
 public Handler(ReactivitiesDbContext context, IMapper mapper)
 {
     _context = context;
     _mapper  = mapper;
 }
Exemplo n.º 21
0
 public FollowingResolver(ReactivitiesDbContext context, IUserAccessor userAccessor)
 {
     _context      = context;
     _userAccessor = userAccessor;
 }