using System.Collections.Generic;
public static void Main()
var list = new List<Request>();
list.Add(new Request{ AccountId = 1, Name = "Yes", WantToTrade = true, PotentialTradeSupplies = new List<Supply>{ new Supply {CanBeTraded = true}, new Supply {CanBeTraded = false}, new Supply {CanBeTraded = false}}});
list.Add(new Request{ AccountId = 2,Name = "No", WantToTrade = false, PotentialTradeSupplies = new List<Supply>{ new Supply {CanBeTraded = true}, new Supply {CanBeTraded = true}, new Supply {CanBeTraded = true}}});
list.Add(new Request{ AccountId = 3,Name = "No", WantToTrade = true, PotentialTradeSupplies = new List<Supply>{ new Supply {CanBeTraded = false}, new Supply {CanBeTraded = false}, new Supply {CanBeTraded = false}}});
var result = from supply in list
where supply.AccountId == accountId
&& supply.WantToTrade && supply.PotentialTradeSupplies.Any(p=>p.CanBeTraded)
Console.WriteLine("Count: " + result.Count());
Console.WriteLine("Prints first from list above : " + result.First().Name + " " + result.First().AccountId);
public int AccountId {get;set;}
public string Name {get;set;}
public bool WantToTrade {get;set;}
public List<Supply> PotentialTradeSupplies {get;set;}
public bool CanBeTraded{ get;set; }