Skip to main content
formatting
Source Link

It is not clear what do you use for Key and what for Value. If your case is: enter image description here

It should work (be mapped) correctly:

public interface INameValueList : ISitecoreItem
    {
        [SitecoreField("Values")]
        NameValueCollection Values { get; set; }
    }

enter image description here

Just check your solution, it is not GlassMapper bug. Value can be any string. Whitespaces are not allowed for Key only (if you try for example to set Key value toto "test1 test3" if will be replaced with "test1_test3" automatically on item save).

It is not clear what do you use for Key and what for Value. If your case is: enter image description here

It should work (be mapped) correctly:

public interface INameValueList : ISitecoreItem
    {
        [SitecoreField("Values")]
        NameValueCollection Values { get; set; }
    }

enter image description here

Just check your solution, it is not GlassMapper bug. Value can be any string. Whitespaces are not allowed for Key only (if you try for example to set Key value to "test1 test3" if will be replaced with "test1_test3" automatically on item save).

It is not clear what do you use for Key and what for Value. If your case is: enter image description here

It should work (be mapped) correctly:

public interface INameValueList : ISitecoreItem
{
    [SitecoreField("Values")]
    NameValueCollection Values { get; set; }
}

enter image description here

Just check your solution, it is not GlassMapper bug. Value can be any string. Whitespaces are not allowed for Key only (if you try for example to set Key value to "test1 test3" if will be replaced with "test1_test3" automatically on item save).

Source Link
x3mxray
  • 3.2k
  • 12
  • 33

It is not clear what do you use for Key and what for Value. If your case is: enter image description here

It should work (be mapped) correctly:

public interface INameValueList : ISitecoreItem
    {
        [SitecoreField("Values")]
        NameValueCollection Values { get; set; }
    }

enter image description here

Just check your solution, it is not GlassMapper bug. Value can be any string. Whitespaces are not allowed for Key only (if you try for example to set Key value to "test1 test3" if will be replaced with "test1_test3" automatically on item save).