public async Task <IActionResult> List(LoginAttemptPagedList model)
        {
            Contract.Requires(model != null);

            // Always set the user parameters of the model on each page (so we don't need to store this sensitive data in the view)
            model.UserId = this.User.GetUserId();
            model        = await this.loginAttemptRepository.GetUserLoginAttempts(model);

            return(this.View(nameof(this.Index), model));
        }
Example #2
0
        /// <inheritdoc />
        public async Task <LoginAttemptPagedList> GetUserLoginAttempts(LoginAttemptPagedList filter)
        {
            var query = this.Entities.AsQueryable().Where(e => e.UserId == filter.UserId);

            return(await filter.ApplyPagingFilter(query, e => e.AttemptDate, true));
        }