Hi there,
I am trying to create an extension method that i can forward a IList of statuses and check weather they exist, I thought the best way to do this was an ILIST - but maybe i wrong? Is this the best way to pass multple items to a method - A List? Its a generic LIST so hence no conversion etc from Object.
Basically I have this as a signature.
public static IQueryable<Building> WithStatus(this IQueryable<Building> qry,
IList<BuildingStatuses> buildingStatus)
{
//PSUEDO CODE
//return from v in qry
// where v.Status is IN MY LIST called buildingStatus
// select v;
}
and to call it i use (example below is in my TDD), it works great the values arrive in my method above.
target.GetBuildings().WithStatus(new List<BuildingFilters.BuildingStatuses>()
{ BuildingFilters.BuildingStatuses.Available,
BuildingFilters.BuildingStatuses.Decommissioned });
so basically i have my list (IList) it arrives in the extension method with 2 values which is great but need to say in LINQ i need to say
return from v in qry
where v.Status is IN MY LIST called buildingStatus
select v;
Really appreciate any help,
with regards to my extension method, it works as i have done similar 1 but only passing type BuildingStatus hence only 1...