c# - What is the purpose of new() while declaration of a generic class? -


what purpose of new() while declaration of baseentitycollection class?
if i'm going remove it, got error following message "t must non-abstract type public parameterless constructor in order use parameter ..."

public abstract partial class baseentitycollection<t> :         list<t> t : baseentity, new() 

it means whatever class specify t, has default (no parameters) constructor.

therefore, in generic class, can new t() , create new object of type t.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -