Constructing Generics Through Reflection (List of Mixed Types Example)


/ Published in: C#
Save to your folder(s)

.net 2.0+ Generic classes make code size much smaller and casting objects (boxing) a cinch. However, currently there are some unsupported IDE options when trying to cast objects to and from generic objects that use mixed object types (inherited from a generic type specifier). Fear not, using reflection we can bypass the IDE and supply the users with strongly typed objects.

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.