Reputation: 3942
Considering I have the following:
Type objectType = typeof(A);
How can I convert objectType to collectionType? Knowing that collectionType represents the following:
Type collectionType = typeof(IList<A>);
Upvotes: 0
Views: 105
Reputation: 3942
As @PetSerAl mentioned in the comments, the way to do it is like this:
typeof(IList<>).MakeGenericType(typeof(A))
Upvotes: 4