Is there a way to deserialize a JSON array directly into the property of an object?
I have a JSON consisting of an array of Entry objects. To get them into a Collection class I could go the route of:
var coll = new Collection();
coll.Entries = JsonConvert.DeserializeObject<List<Entry>>(json);
Is there a way to define Collection in a way to skip this step an directly call var coll = JsonConvert.DeserializeObject<Collection>(json)
CollectionimplementIEnumerable<Entry>and see if that works.Entryobjects why it deserialize to object? deserliazation should do same object structure as source.