Skip to content

Instantly share code, notes, and snippets.

@controlflow
Created January 15, 2015 19:46
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 controlflow/be428287b7e08c306559 to your computer and use it in GitHub Desktop.
Save controlflow/be428287b7e08c306559 to your computer and use it in GitHub Desktop.
[DebuggerDisplay("Person(Name={" + nameof(Name) + ",nq}, Age={" + nameof(Age) + ",nq})")]
// vs.
[DebuggerDisplay($"Person(Name={{{ nameof(Name) },nq}}, Age={{{ nameof(Age) },nq})")]
class Person {
public string Name { get; }
public int Age { get; }
public Person(string name, int age) {
this.Name = name;
this.Age = age;
}
public override string ToString() => $"Person(Name=\"{Name}\", Age=\"{Age}\")";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment