In C#, if I have multiple List<T> lists, where each item in the list inherits from an interface that has an id property, how is the best way to retrieve an object that has a specific id?
All ids are unique and all lists are stored in one object.
I am currently thinking of writing a Find piece of code, for each list, and if the object returned is not null, then the object returned is the object with the id.
Is there a better way to do this?
Just to inform, this question is about how to find an object in multiple lists, rather than the code to find an object in a single list.