Sitecore Quick Tip: Getting and Setting SafeDictionary

Sitecore Api

Sitecore's SafeDictionary is used throughout Sitecore's libraries and the purpose of it (as opposed to using Dictionary) is to allow dictionary[key] without exceptions, instead returning default(T).

To read values into a SafeDictionary from a Sitecore field that uses a query string internally (validator parameters, rendering parameters, name value field etc.) you can use: