private static string GetGravatar(string email, object gravatarAttributes)
{
Contract.Requires<ArgumentException>(!string.IsNullOrEmpty(email));
var attributes = (gravatarAttributes == null ? new RouteValueDictionary()
: new RouteValueDictionary(gravatarAttributes));
var returnVal = GetGravatar(email);
var first = true;
foreach (var key in attributes.Keys) {
if (first) {
first = false;
returnVal += string.Format("?{0}={1}", key, attributes[key]);
continue;
}
returnVal += string.Format("&{0}={1}", key, attributes[key]);
}
return returnVal;
}