Monday 6 July 2009

Parameter constraint on dynamic type

It can be accomplished by using the new() keyword.
"new()" indicates the Type T's constructor must not contain any parameters.

Example:

public class A<T> where T : B, new()

No comments: