title: Parsing Data From JSON To Windows Form
body: <p>I am retrieving JSON from a web service and am getting this error:</p>
  
  <blockquote>
    <p>Error CS0030  Cannot convert type 'PokeForm.MoveInformation' to 'PokeForm.Move'</p>
  </blockquote>
  
  <p>This is the code I am using to query the web service and the classes I use to parse the data into the format I need:</p>
  
  <pre><code>private void GrabData()
  {
      WebClient syncClient = new WebClient();
      string url = "https://pokeapi.co/api/v2/pokemon/lucario/";
      string response = syncClient.DownloadString(url);
  
      var bl = JsonConvert.DeserializeObject&lt;PokeAPI[]&gt;(response);
      foreach (PokeAPI ro in bl)
      {
          if (ro.Moves != null)
          {
              foreach (MoveInformation mi in ro.Moves)
              {
                  Move mv = mi.Move;
                  MessageBox.Show(mv.Name);
              }
          }
      }
  }
  
  public class PokeAPI
  {
      public List&lt;MoveInformation&gt; Moves { get; set; }
  }
  public class MoveInformation
  {
      public Move Move { get; set; }
  }
  public class Move
  {
      public string Name { get; set; }
      public string Url { get; set; }
  }
  </code></pre>
  
  <p>What needs to be changed in my <code>foreach</code> loop so that the data will display as I desire?</p>
  
  <p><strong>EDIT</strong><br>
  I edited my syntax to the below per the answer</p>
  
  <pre><code>foreach (MoveInformation mi in ro.Moves)
  {
    Move mv = mi.Move;
    MessageBox.Show(mv.Name);
  }
  </code></pre>
  
  <p>And now I get this run-time error:</p>
  
  <blockquote>
    <p>Newtonsoft.Json.JsonSerializationException: 'Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'PokeForm.PokeAPI[]' because the type requires a JSON array (e.g. [1,2,3]) to deserialize correctly.
    To fix this error either change the JSON to a JSON array (e.g. [1,2,3]) or change the deserialized type so that it is a normal .NET type (e.g. not a primitive type like integer, not a collection type like an array or List) that can be deserialized from a JSON object. JsonObjectAttribute can also be added to the type to force it to deserialize from a JSON object.</p>
  </blockquote>
  
  <p>This is the JSON - <a href="https://pokeapi.co/api/v2/pokemon/lucario/" rel="nofollow noreferrer">https://pokeapi.co/api/v2/pokemon/lucario/</a></p>