I'm looking at the source code for the MvcContrib Grid and see the class declared as:
public class Grid<T> : IGrid<T> where T : class
What does the where T : class bit do?
where T : class
It is a generic type constraint.
In this case it means that the generic type (T) must be a reference type, that is class, interface, delegate, or array type.
T
Other constraints are listed here.
You can also constrain the generic type to inherit from a specific type (base class or interface)
1.4m articles
1.4m replys
5 comments
57.0k users