private bool IsValidUser(SignInModel model) { //DATABASE WOULD DO THIS NORMALLY if(model.UserName == "brad" && model.Password == "password") return true; return false; }
public ActionResult SignIn(SignInModel model) { bool isValid = IsValidUser(model); if (!isValid) { ModelState.AddModelError("", "Your username or password is invalid"); return View(model); } else //is a valid user return RedirectToAction("MostViewed", "Home"); }