Struggling Newbie :(
Entity not fetching the User..
Login Controller
[HttpPost]
public ActionResult LoginForm(string user_NA, string user_pwd)
{
User u = new User();
u.LogIn(user_NA, user_pwd);
return RedirectToAction("Index");
}
Login Model
public bool LogIn(string userID, string password)
{
using (Entity.xcLEntities en = new xcLEntities())
{
try
{
var user = en.Users.SingleOrDefault(x => x.LoginID == userID && x.PasswordHash == this.SetPassword(password));
if (user != null && password != null)
{
return true;
}
else
{
return false;
}
}
catch (Exception e)
{
throw e;
}
}
}
Exception shoing
An exception of type 'System.NotSupportedException' occurred in AML.Web.dll but was not handled in user code
Additional information: LINQ to Entities does not recognize the method 'System.String SetPassword(System.String)' method, and this method cannot be translated into a store expression.