Skip to content

Instantly share code, notes, and snippets.

@masaeedu
Last active June 4, 2017 00:52
Show Gist options
  • Save masaeedu/46f7b4f6175734059ddcec20b53602e2 to your computer and use it in GitHub Desktop.
Save masaeedu/46f7b4f6175734059ddcec20b53602e2 to your computer and use it in GitHub Desktop.
"var" for props/fields
static class X
{
public static X<T> Create<T>(T t) { return new X<T>(t); }
}
class X<T>
{
T MyT { get; }
public X(T t)
{
MyT = t;
}
}
class Program
{
static void Main()
{
var x = X.Create(10);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment