Hi
I have classes:
public class Deal
{
public int DealId { get; set; }
public string Title { get; set; }
public Dealproduct[] DealProducts { get; set; }
}
public class Dealproduct
{
public int ProductId { get; set; }
}
public class Product
{
public int ProductID { get; set; }
public string ProductTitle { get; set; }
}Now I have List of deals named selectedDeals. and List of products is selection:
selectedDeals = selectedDeals.Where(x => (something));
List<int> deviceIds = new List<int>();
//HERE IS THE PROBLEM. How do I put all the distinct productIds in the deviceIds list with Linq?
selection = selection.Where(x => deviceIds.Contains(x.ProductID ));How do I put all the distinct productIds in the deviceIds list with Linq?
Please advice