I was searching for reusable Grid for MVC .Net. I found one open source Grid.
In the code I found a pretty interesting class declaration which I didn’t understand
.
Can anybody tell me a detailed description of class declaration below:
public class Grid<TEntity, TSearchForm> : IGrid where TSearchForm : SearchForm, new()
{
}
Also how do I create an instance of this class?
The class is a generic class, it implements
IGrid.The two generic type parameters are
TEntityandTSearchForm.TSearchFormis constrained to beSearchFormor a type that inherits fromSearchFormand that it has a default constructor.Suggested reading: