I'm still new to modern styles .NET development and Entity Framework. I'm trying to get a list of objects where one of the values falls in a list of other values, and I'm trying to use the LINQ query methods to do so.
string cb_orderstatus = Request.Query["OrderStatusSearch"].ToString();
if (!string.IsNullOrEmpty(cb_orderstatus))
{
string[] orderStatuses = cb_orderstatus.Split(",");
query = query.Where(o => orderStatuses.Contains(o.Status.ToString()));
}
If the value of the cb_orderstatus is a string array containing 5, 10, and 15, I want the query to return objects where their Status equals any of these values. Currently it is not working. Can anyone help?