How can I improve this username/password checking?
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Login(FormCollection collection)
{
var users =
(from p in _dataContext.Users
where p.Name == collection["Username"] && p.Password == collection["Password"]
select p);
if (users.Count() > 0)
{
// Login Succeed
// To get the username I should do something like users.First().Name
// and that's really bad...
return RedirectToAction("Login");
}
else
{
// Login Faild
return View();
}
}