I have two lists, one fake and one real, for example:
before
// fake (list 1) { ID = 1, Year = 2011, X = "" } , { ID = 2, Year = 2012, X = "" } , { ID = 3, Year = 2013, X = "" } // real (list 2) { ID = 35, Year = 2011, X = "Information" } , { ID = 77, Year = 2013, X = "Important" }
I want to combine them in the search for the Year, the result should be:
after
{ ID = 35, Year = 2011, X = "Information" } , { ID = 2, Year = 2012, X = "" } , { ID = 77, Year = 2013, X = "Important" }
He must remove items with the same year in the first list and add an item with the equivalent Year to the second list in the first list, keeping order.
How can I do this with Linq?
Brunolm
source share