Okay so I have a class containing multiple properties of type List
.
Some of the lists are just simple types like string
, int
etc.
But some are lists of custom types like Feature, Trailer, Artwork etc.
public class Movie : IMedia
{
public List<Feature> Features;
public List<Artwork> Artwork;
public List<string> Genres;
}
All the custom types (and the Movie class itself) implement the interface IMedia
.
Using reflection I want to traverse the Movie properties and do something with those that is of type List<IMedia>
- but here lies the problem; Because apparently I can't just use is List<IMedia>
when also wanting to specify the property to be of a specific type like List<Feature>
.
How would you guys suggest I go about identifying these types?
Extend List<T>
itself or something completely different?