Skip to content

Instantly share code, notes, and snippets.

@dcomartin
Created October 12, 2016 23:16
Show Gist options
  • Save dcomartin/240fd092742f9046a84d2d6ec6a9d18e to your computer and use it in GitHub Desktop.
Save dcomartin/240fd092742f9046a84d2d6ec6a9d18e to your computer and use it in GitHub Desktop.
using System.Diagnostics;
namespace DebuggerDisplay
{
class Program
{
static void Main(string[] args)
{
var person = new Person("Derek", "Comartin", "derek@codeopinion.com", "codeopinion");
}
}
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class Person
{
public string Firstname { get; }
public string Lastname { get; }
public string Email { get; }
public string Twitter { get; }
internal string DebuggerDisplay => $"{Firstname} {Lastname}";
public Person(string firstname, string lastname, string email, string twitter)
{
Firstname = firstname;
Lastname = lastname;
Email = email;
Twitter = twitter;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment