I have 2 list which contains close to 500k+ records. List <Animal> and List <Zoo>.
The Model
Animal
Id
BllodType
ZooId
Zoo
Z_ID
ZooName
ZooAdress
I need to write a LINQ function where it could return a List of Animals
that matches the ZooId
(Z_Id
).
What I tried to do :
List<Animal> matchingAni= allZooList.Any(x => allAnimalList.Contains(x));
It says
Cannot convert from Animal to Zoo.
Note: Since, I have 500k+ records in these Lists, I am looking for a optimized way to traverse these list in lesser time.