linq where condition in list c# code example
Example 1: linq c# where condition
var query = MemberTable.Where(x=>x.sex.Equals(Sex))
if (members != null)
query = query.Where(x=>members.Contains(x.membercode))
//use your query
query.ToList();
Example 2: from where in list linq
var filteredOrders = from order in orders.Order
where allowedStatus.Contains(order.StatusCode)
select order;