Often when working within Umbraco, you will work need to work with content and the IContent objects. When you work with IContent you don't necessarily know the document type you are working with. If you try and use GetValue() and the property doesn't exist, Umbraco will throw a 'The given key was not present in the dictionary' exception. If you find yourself in this situation you can use 'HasProeprty'
var content = IContent; content.HasProperty("alias");
Just because you use HasProperty() it doesn't mean the property contains a value and hasn't been set. When this happens you can use:
So, if you need to check that a property exists and has been set, you could do something like this:
If you are working IPublishedContent you can do something similar and use HasValue() instead.