This is a general type restriction, indicating that the type should have an open constructor with no parameters.
myCloudTableClient.CreateTableIfNotExist<TypeWithPublicParameterlessConstructor>("Customers");
Further reading .
The main use of this is to allow generic code to instantiate T , not default(T) you often see. Unfortunately, there is no support for constraints for anything other than an open constructor without parameters when it comes to constructor constraints.
Update: looking at the updated code, the general one is not used, so in this case it has no purpose. A common tactic for generics in extension methods is to support common extension methods.
public static bool Equals<T>(this T self, T other) where T : IEquatable<T> { return self.Equals(other); }
Update 2: in your example, do not specify a type restriction, this will only work if the type restriction can be inferred by the compiler based on usage ... I'm not sure what will happen in your case, but I would assume that it will not compile.
source share