interface<T> where T : class

c#, generics

Solution

Check my full post here : Constrain on custom generic type which talks about different type of generic constrain

it's Reference Type Constrain

Constrain ensure that type argument is Reference Type. i.e Class, Interface, Delegates, Array etc.

interface iSend<T> where T : class

Example

Valid             InValid
A<MyClass>        A<int>
A<InterfaceME>    A<float>   
A<float[]>  

Note : Always come first when multiple constrain applied.

Problem

``` interface<T> where T : class ``` for example ``` public interface iSend<T> where T : class ``` What does the above code mean? Why to use this? When to use this?

Original source

Related problems