Alex Rivera | Logout

Reflection over Type Constraints

Asked 2011-03-25T13:07:42.147
17

In class and method definitions, it's possible to add type constraints like where T : IFoo.

Is it possible to reflect over those constraints with System.Type or MethodInfo? I haven't found anything so far; any help will be appreciated.

Edit
Report

1 Answer

4

You can use the GetGenericParameterConstraints() method to do that.

answered 2011-03-25T13:10:51.217

Your Answer