i am having a foreach loop that i am trying to turn into a linq query
List<CustomType> typeList=new List<CustomType>();
List<int> ListID=new List<int>();
foreach (Info info in SubDetails)
{
if (typeList.Contains(info.TypeID))
{
ListID.Add(info.OrderID);
}
}
Now i am trying to turn it into a linq loop
SubDetails.ForEach(u => List.AddRange(
typeList.Contains(ID or something)
.Select(u.OrderID)));
But that did not work obviously, Kindly guide me towards the right direction
Try this: