LINQ expression to get the difference of 2 list with a property

advertisements

I have 2 list with Properties

public class Lookup
{
public int SlNo{get;set;}
public int StoreId{get;set;}
public int ItemId{get;set;}
public string Name{get;set;}
public int Price{get;set;}
}
List<Lookup> current;
List<Lookup> history;

i want to get a new list

List<Lookup> changes;

Where changes contains items from current with a difference in Price property on items in history. Is there any LINQ expression like JOIN or INTERSECT to filter it out? Or do I need to manually iterate through all items? If it's JOIN how can I do it on 2 properties ItemId and StoreID (combination of these 2 is unique).


You mean this?

changes = (from c in current
           join h in history on c.Id equals h.Id
           where c.Price != h.Price &&
           c.StoreId == h.StoreId
           select c).ToList();