I have a web application using MVC and MySql for the database. How created a sign in form but I don't know how to sign in using DbContext. I tried it but doesn't work:
[HttpPost]
public ActionResult Login(AccountModel objAccount)
{
if(objMyDbContext.ObjAccountModel.ToList().Count==1) return RedirectToAction("Index", "Home");
return RedirectToAction("Login", "Account");
}