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?
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?
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);