DebuggerDisplayAttribute Makes Debugging Clearer

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.


Short Guid

In my daily perusing of DotNetKicks and related blogs for the desire to continue to expand my knowledge of C# development I came across Short Guid. This is a very simple concept but not one I’d have ever considered myself. In summation the idea of Short Guid is

Is take a regular guid like: c9a646d3-9c61-4cb7-bfcd-ee2522c8f633

And shortens it to a smaller string like this: 00amyWGct0y_ze4lIsj2Mw

This was basically all handled by just converting the guid to a btye array then base64 encoding of it handling 2 special cases of specific characters to be encoded easily for URLs. See the full article on Dave Transom’s blog at:

ShortGuid – A shorter and url friendly GUID class in C#

Which was based off the orginal idea on Mads Kristensenblog at:

A shorter and URL friendly GUID