Hai friends,
I am beginner to MVC.
I have created registration.cshtml & login.cshtml.
How to check whether the user is valid user or invalid user?
In asp.net I used as:
select count(*) from Users where mailid=" " & password= " "
if it returns 0 i simply said user is invalid else valid user.
The same scenerio how to use in MVC with LINQ or Lambda Expression?
Please reply me what type of code I need to write?

Saineshwar BageriPosted Nov 21, 2014, 7:37 AM
which tell user is exists or not
Sreekanth ReddyPosted Nov 21, 2014, 6:17 AM
Saineshwar BageriPosted Nov 20, 2014, 11:25 PM
int userId = (from u in db.Users
where u.mailid == EmailID && u.password = Password
select u.Id).firstOrDefault();
Mark as answer if i solved your issue