I have a list of products, but I want to simplify it into a tuple since I only need the productId and brandId from each product. Then in later code would like to check if the list of tuple contains a tuple where Item1 = x, and in a separate case where Item2 = y.
List<Tuple<int, int>> myTuple = new List<Tuple<int, int>>();
foreach (Product p in userProducts)
{
myTuple.Add(new Tuple<int, int>(p.Id, p.BrandId));
}
int productId = 55;
bool tupleHasProduct = // Check if list contains a tuple where Item1 == 5