public async Task <ActionResult> LoginCheck(string username, string password) { if (username != null && username.Length > 3 && password != null && password.Length > 3) { await _context.Users.ToListAsync(); await _context.Blogs.ToListAsync(); foreach (Users u in _context.Users) { if (u.Username == username && u.Password == password) { var Users = from w in _context.Users select w; foreach (Blogs b in _context.Blogs) { Users.Where(x => x.Id == b.UserID).SingleOrDefault().BlogNumber++; } int?page = 1; int pageSize = 5; Users = Users.OrderBy(Q => Q.Name); return(View("Home", await PaginatedList <Users> .CreateAsync(Users.AsTracking(), page ?? 1, pageSize))); } } } LoginErrorVM Error = new LoginErrorVM { ErrorFound = true }; return(View("login", Error)); }
public ActionResult Index() { LoginErrorVM Model = new LoginErrorVM(); return(View("login", Model)); }