"where" keyword in class declaration in c sharp

.net, c#, generics

Solution

`where TEntity : ...` applies constraints to the generic parameter TEntity. In this case, the constraints are:

class: The argument to TEntity must be a reference type IEntity: The argument must be or implement the IEntity interface new(): The argument must have a public parameterless constructor

From http://msdn.microsoft.com/en-us/library/d5x73970.aspx

Problem

Could anyone help me with the line `where TEntity : class, IEntity, new()` in the following class declaration. ``` public abstract class BaseEntityManager<TEntity> where TEntity : class, IEntity, new() ```

Original source