I am trying the get the different of two lists with a LINQ query. But the lists are not of the same type.
List<Vehicle> unsoldVehicles
List<string> ListDetailUrls
Each Vehicle Object has a field called UrlID (string) while the ListDetailUrls list consists only of strings. I need every Vehicle from the Vehicle List where the field UrlID does not match an entry ListDetailUrls.
What I have done so far is :
List<Vehicle> missingVehicles = new List<Vehicle>(
from uV in unsoldVehicles
from de in ListDetailUrls
where uV.UrlID != de
select uV);
But with a query like this my missingVehicles are more items than the unsoldVehicles!
I was looking for a way to use the Except-method somehow but I only find samples where both lists are of the same type.