Below is my code.
public IQueryable GetCarsByStatusId(List<int> statusIds = null)
{
IQueryable data = null;
if(statusIds == null)
{
data = this.Context.ACRViewCars.OrderBy(x=>x.Status);
}
else if(statusIds != null && statusIds.Count > 0)
{
foreach(int id in statusIds)
{
var query = this.Context.ACRViewCars.Where(x => x.StatusId == id);
if(query != null)
{
//What to do here; I have no idea
}
}
}
return data;
}
The scenario is: I have a list and using this, I want to retrieve data from IQueryable source (this.Context.ACRViewCars). And if data found, I want to merge the records in one single IQueryable object (data). Can anyone help please?