Reputation: 1
I have two string which i have to iterate through linq ?
I have status as column and its having row value of
Status
--------
Int
String
Boolean
Char
Float
LINQ
var result = from desc in result
where desc.Status == "string" && desc .Status == "Int"
select desc ;
How to achieve this .. I have tried but it returns empty. If i try with single check its working correctly.
Upvotes: 0
Views: 867
Reputation: 428
var result = from desc in result
where new[] {"Int","String","Boolean","Char","Float"}.Contains(desc.Status)
select desc ;
Upvotes: 1
Reputation: 133403
You need to use ||
operator
where desc.Status == "string" || desc .Status == "Int"
Upvotes: 5