1

I have to deserialize an JSON object array that contains a colon in root object name.

Does anyone know if I can achieve this somehow with colon in list definition?

public List<Customers> ngcp:customers { get; set; }
StriplingWarrior
  • 151,543
  • 27
  • 246
  • 315

1 Answers1

6

No, the proper way to do this would be to specify the name using an attribute or other method supported by json.net.

[JsonProperty(PropertyName = "ngcp:customers")]
public List<Customers> Customers { get; set; }

LINQPad example

StriplingWarrior
  • 151,543
  • 27
  • 246
  • 315
  • Thanks, could you please help me with that object collection of ngcp:customers? I'd like to get every object in that collection and use it for datagrid: – Martin Stix Oct 24 '14 at 10:19
  • http://www.felferhuette.at/box/public.php?service=files&t=5b1816ae1db36ce362abcbad45fec1fd – Martin Stix Oct 24 '14 at 10:24