Reputation:
I have tried one where clause in Linq to get details about User
s those who are Active
and AllowLogin
is also true.
So how can I compare the table values (both are boolean values) with true or false?
Upvotes: 4
Views: 9486
Reputation: 67
var qry = (from en in Contaxt.tblStatDefinitions
where en.Name == "Sunandan"
select en.id).Single();
Upvotes: 0
Reputation: 1504052
Just use something like:
var query = from user in context.Users
where user.Active && user.AllowLogin
select user;
Alternatively, you can write the same query without a query expression:
var query = context.Users.Where(user => user.Active && user.AllowLogin);
Upvotes: 14