I have a List of type some entity
List
public class OrderLine
{
public string productCode;
public int quantity;
}
i need to remove items from the above List if the productCode is equal to some products.
List<string> ProductsToBeExcluded = new List<string>(){"1234","1237"};
so, from List<OrderLine>
i need to remove products which are equal to 1234 and 1237
i have tried
create a
List<string>
fromList<OrderLine>
usingList<OrderLine> OrderLines = GetOrderLines(); var ol = from o in OrderLines select o.ProductCode;
2.
List<string> ProductsToBeExcluded = new List<string>(){"1234","1237"};
var filtered = OrderLines.Except(ProductsToBeExcluded);
how do I proceed further in removing
thanks