Created
October 12, 2016 23:16
-
-
Save dcomartin/240fd092742f9046a84d2d6ec6a9d18e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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