Skip to content

Instantly share code, notes, and snippets.

@kevingosse
Last active December 19, 2018 07:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevingosse/6f98a60283e15e3923fa50efbee042ef to your computer and use it in GitHub Desktop.
Save kevingosse/6f98a60283e15e3923fa50efbee042ef to your computer and use it in GitHub Desktop.
public class Foo : BaseClass { }
public class Bar : BaseClass
{
public Bar() : base() { }
}
public class BaseClass
{
public BaseClass([CallerMemberName] string val = "Foo")
{
Console.WriteLine(val);
}
}
class Program
{
static void Main(string[] args)
{
new Foo(); // Prints Foo
new Bar(); // Prints .ctor
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment