I suppose that this is an easy question but I couldn't find the right answer. What means this syntax? I'm kind of confuse about the new() at the end of the line:
public abstract class SomeClass<E> : Controller where E : ISomeInterface, new()
{
//code of the abstract class
}
The new constraint specifies that any type argument in a generic class declaration must have a public parameterless constructor. To use the new constraint, the type cannot be abstract.
From: http://msdn.microsoft.com/en-us/library/sd2w2ew5.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With