BookManagement.Web.Controllers.AccountController.Login C# (CSharp) Method

Login() private method

private Login ( Account account ) : System.Web.Mvc.ActionResult
account BookManagement.Core.Models.Account
return System.Web.Mvc.ActionResult
        public ActionResult Login(Account account)
        {
            if (ModelState.IsValid)
            {
                List<Account> l = db.Accounts.Where(a => a.UserName == account.UserName).ToList();

                if (l.Count > 0)
                {
                    if (l[0].Password == account.Password)
                    {
                        FormsAuthentication.SetAuthCookie(account.UserName, true);
                        return RedirectToAction("Index", "Home");

                    }
                }
            }

            ModelState.AddModelError("", "Invalid username or password!");
            return View();
        }

Same methods

AccountController::Login ( ) : System.Web.Mvc.ActionResult