public ActionResult Login(LoginViewModel model) { //_usersProvider.LoginUser(model.Login, model.Password); var user = _usersProvider.LoginUser(model.Login, model.Password); if (user == null) { model.UserNotExist = true; } else { UserContext.SetUser(user); return(RedirectToAction("Profile")); } return(View(model)); }