I've got the following JSON:
{"workspaces":{ "workspace":[ {"name":"Berlin","href":"http://10.80.14.188:8080/geoserver/rest/workspaces/Berlin.json"}, {"name":"Paris","href":"http://10.80.14.188:8080/geoserver/rest/workspaces/Paris.json"}, {"name":"Rome","href":"http://10.80.14.188:8080/geoserver/rest/workspaces/Rome.json"}, {"name":"London","href":"http://10.80.14.188:8080/geoserver/rest/workspaces/London.json"}, {"name":"usa","href":"http://10.80.14.188:8080/geoserver/rest/workspaces/usa.json"}, {"name":"Lisboa","href":"http://10.80.14.188:8080/geoserver/rest/workspaces/Lisboa.json"}, {"name":"Madrid","href":"http://10.80.14.188:8080/geoserver/rest/workspaces/Madrid.json"} ]}}
The following class:
public class elementosJSON
{
[DataMember(Name = "name")]
public string name { get; set; }
[DataMember(Name = "href")]
public string href { get; set; }
}
And I´m trying to fill my class with the json but the elements are always null. I´m using:
ObjJSON test = JsonConvert.DeserializeObject<ObjJSON>(data);
My environment is Visual Studio 2010 C#.
Any ideas? I´m a newbie with C#.