I have a List called buildingStatus. I\'d like to check whether it contains a status whose char code (returned by GetCh
If I understand correctly, you need to convert the type (char value) that you store in Building list to the type (enum) that you store in buildingStatus list.
(For each status in the Building list//character value//, does the status exists in the buildingStatus list//enum value//)
public static IQueryable WithStatus(this IQueryable qry,
IList buildingStatus)
{
return from v in qry
where ContainsStatus(v.Status)
select v;
}
private bool ContainsStatus(v.Status)
{
foreach(Enum value in Enum.GetValues(typeof(buildingStatus)))
{
If v.Status == value.GetCharValue();
return true;
}
return false;
}