user1237131
user1237131

Reputation: 1863

Linq to sql query for check the usernames exists in table?

Any one please tell me how to a write query for user is already exists or not in a table using linq to sql and Entity Framework?

Upvotes: 0

Views: 1268

Answers (1)

undefined
undefined

Reputation: 34238

bool doesUserExist = myContext.Users.Any(u=>u.Username == "bob" && u.Password=="mypassword");

Upvotes: 3

Related Questions