How to create a list of values in C# based on the following data?
I have the following which I need to be converted into list:
- Players: [
- {
- Player: {
- PlayerType: Advanced,
- PlayerRole: 12
- }
- }
- ]
- }
and I did this
- public class Players
- {
- public Players()
- {
- Player = new PlayerMemo();
- }
- [JsonProperty("Player")]
- public Player Player { get; set; }
-
- }
-
- public class Player
- {
-
- public string PlayerRole { get; set; }
-
- public string PlayerType { get; set; }
-
- }
I need to convert this into one line list and add it to the previously declared
localvariable.list = here-goes-my-one-line-list: (something like this)
- loadgroup.Players = new Players()
- {
- { new Players() {"PlayerRole", "Member"} },
-
- };