我有对象:
public class Cars
{
public id CarId {get;set;}
public ClientList[] AvaList {get;set;}
}
public class ClientList
{
Client[] ClientData {get;set;}
}
public class Client
{
int ClientId {get;set;}
}
在我获取汽车列表的方法中:
string cId = 10;
Cars cars = GetCars();
var carsForClientId = cars.AvaList.SelectMany(c => c.ClientData.Where(x => x.ClientId == cId));
但是
carsForClientId
是IEnumerable<Client>
。我想得到 IEnumerable<Cars>
只包含 CliendId = 10
的数据;