Useful Attributes in Visual Studio
For me , I like
1 | [DebuggerDisplay("FirstName={FirstName}, LastName={LastName}")] |
and
1 | [DebuggerStepThrough] |
The code is the following:
1 | class Program { static void Main( string [] args) { var p = new Person(); p.FirstName = "Andrei"; p.LastName = "Ignat"; Console.WriteLine(p.Name()); //InternalsVisibleToAttribute //Obsolete //All Attributes: https://msdn.microsoft.com/en-us/library/system.attribute.aspx } } [DebuggerDisplay("FirstName={FirstName}, LastName={LastName}")] class Person { public string FirstName { get; set; } public string LastName { get; set; } [DebuggerStepThrough] public string Name() { return FirstName + " " + LastName; } } |
and the video is at https://youtu.be/ShBr1GgpZKs
Leave a Reply