0

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");
}

1 Answer 1

1

you can use IdentityUser and signInManager that provides inbuilt login support.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.