I have an array of objects like this in json as per below format
[{"GroupID":5},{"GroupID":47}]
What's the correct way to deserialize it?
I have the Group object:
public class Group
{
[JsonProperty("GroupID")]
public int Id { get; set; }
}
I'm trying to deserialize by:
Group[] arr = JsonConvert.DeserializeObject<Group[]>(json).Select(j => j.Group).ToArray()
but I get a compiler error - probably due to a missing linking class:
'Group' does not contain a definition for 'Group' and no extension method 'Group' accepting a first argument of type 'Group' could be found (are you missing a using directive or an assembly reference?)