Did you know in .net #1 (default keyword in generic)

Tags: c#, asp net, MVC

T t = default(T);

Default vary by type of T where results in a 'null' if T is a reference type, false if it is a Boolean, 0 if is int and so on.

Add a Comment