I have two databases DB1 and DB2 where I am retrieving sales orders from each and into lists. I now want to find the sales orders that are missing in DB2 that are in DB1 so that they are added to DB2
I have listDB1
and ListDB2
in the form:
public class SalesOrder
{
public int docNum;
public string cardCode;
public string cardName;
public DateTime docDate;
public DateTime docDueDate;
public double docTotal;
public int lineItemCount;
public string comments;
}
I now want to compare the 2 lists ignoring the docNum
for both lists which is auto-generated while comparing the rest of the elements. Using:
unaddedSOs = listDB1.Except(listDB2).ToList();
compares all including docNum. How do I achieve what I need so I can get the doc Numbers that are unadded?