So today I came across another very useful blog post this one was about the attribute DebuggerDisplayAttribute. It allows you you to change what is output when you look at an object (especially useful in a collection of objects) to see something other than the value of what .ToString() displays which is generally just the name space and class definition which is less than optimal.
Example used in the article
[DebuggerDisplay("Id = {Id}, Title = {Title}, Rating = {Rating}")]
public class Movie
{
public int Id { get; set; }
public string Title { get; set; }
public float Rating { get; set; }
}
I think it’s pretty clear of the intent with this snippit but take a look at Greg Beech’s blog over at Tips & Tricks: Use DebuggerDisplayAttribute for easier debugging to see more detailed usage and some action screen shots.
BloggingContext.ApplicationInstance.CompleteRequest();