Thanks for your reply it took some going over.
What I did was, read in both the deserialized XML files and stored them into objects, used those objects to store into LISTS, created an empty list to store the unique records into, iterated through both lists (fl and fl1) to find unique values and store any unique values into the empty list and then finally returned the list as object to use elsewhere.
It took some going over but got there in the end....
public CARS getUniqueFlightRecords()
{
DeserializeXML file1 = new DeserializeXML();
DeserializeXML file2 = new DeserializeXML();
CARS xmlFile1 = file1.deserializeFileOne();
CARS xmlFile2 = file2.deserializeFileTwo();
List<cars> fl = xmlFile1.CARS.ToList();
List<cars> fl1 = xmlFile2.CARS.ToList();
List<cars> flx = new List<cars>();
flx.AddRange(fl1);
foreach (var item in fl)
{
string carNum= item.CarID.Trim() + item.ManuCode.Trim();
if (!fl1.Any(x => string.Equals(x.CarID.Trim() + x.ManuCode.Trim(), carNum)))
{
flx.Add(item);
}
}
CARS vehicle = new CARS();
vehicle.CARS = flx.ToArray();
vehicle.CURRENT_DATE = DateTime.Now.ToString();
return vehicle;
}
There are other more easier ways of doing this like merging both files into 1 file which will contain duplicates and iterate through that list only and store unique records into an empty list
Thanks anyway I only put the solution up for anyone who may need to do this kind of thing.