How best to turn a JArray of type Type into an array of Types?

myJArray.ToObject<int[]>();

You can also specify HashSet, List etc.

The accepted answer relies on .NET’s conversion – this technique uses JSON.NET’s own in addition to what .NET can provide so works with more scenarios.

It’s also faster as it isn’t using a generator & closure for the LINQ operation.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)