Closed forbjok closed 10 years ago
What is difference between:
if (data.GetType().GetInterfaces().Contains(typeof(IDictionary<string, object>)))
and
if (data is IDictionary<string, object>)
Because it seems to me like second is faster and more readable...
Workaround for what appears to be a bug in CavemanTools - if .ToDictionary() is called on a dictionary, it will fail with the rather uninformative exception "Operation could destabilize the runtime". This works around it by simply checking if the data object implements IDictionary<string, object> and if so, not running ToDictionary() on it, since it doesn't need to be converted anyway.