public AdminController(UserManager <AppUser> usrMgr, IUserValidator <AppUser> userValid, IPasswordValidator <AppUser> passValid, IPasswordHasher <AppUser> passwordHash, EFCDatabaseRequestLogger logger) { userManager = usrMgr; userValidator = userValid; passwordValidator = passValid; passwordHasher = passwordHash; _logger = logger; }
public async Task Invoke(HttpContext httpContext, EFCDatabaseRequestLogger logger) { Request request = new Request { Path = httpContext.Request.Path.ToString(), IPAddressClient = httpContext.Connection.RemoteIpAddress.ToString(), Time = DateTime.Now.ToString(), UserAgent = httpContext.Request.Headers.ContainsKey("User-Agent") ? httpContext.Request.Headers["User-Agent"].ToString() : "no User-Agent" }; await logger.LogRequest(request); await _next.Invoke(httpContext); }