Im trying to map Sitecore "Name Value List" field to NameValueCollection using below code which is not working.
[SitecoreType(AutoMap = true)]
public interface IManifest
{
string Title { get; set; }
string Description { get; set; }
string Author { get; set; }
[SitecoreField("ErrorMessages")]
NameValueCollection ErrorMessages { get; set; }
}
all other field values are being mapped except for "ErrorMessages". Does it require additional code/configuration to achieve this?
NameValueCollection
andDictionary<,>
types (and has been for a few years) which both usesHttpUtility.ParseQueryString()
under the hood, so theoretically your code should work unless you are using a very old version. Have you tried usingDictionary<string, string>
instead?