Wednesday, June 10, 2015


I got an error recently when I enable DonutCache donutHole-based caching for a RenderAction:
Type 'System.String[]' with data contract name 'ArrayOfstring:' is not expected. Consider using a DataContractResolver or add any types not known statically to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding them to the list of known types passed to DataContractSerializer.
It seems RouteValueDictionary cannot manage IEnumerable or String[] as a parameter. The solution is simple, it's a well-known issue:

So this is how you can use the extension method:
                             new RouteValueDictionary(new 
                             {      usual properties here }));