Convert Newtonsoft.Json.Linq.JArray to a list of specific object type

I have the following variable of type {Newtonsoft.Json.Linq.JArray}.

properties["Value"] {[
  {
    "Name": "Username",
    "Selected": true
  },
  {
    "Name": "Password",
    "Selected": true
  }

]}

What I want to accomplish is to convert this to List<SelectableEnumItem> where SelectableEnumItem is the following type:

public class SelectableEnumItem
    {
        public string Name { get; set; }
        public bool Selected { get; set; }
    }

I am rather new to programming and I am not sure whether this is possible. Any help with working example will be greatly appreciated.

6 Answers
6

Leave a Comment