title: Foreach statement cannot operate on type ' ' because it does not contain a public definition for 'GetEnumerator'
body: <p>I have the following in my Api Controller:</p>
  
  <pre><code>[AcceptVerbs("POST")]
  public Model.ViewModel.ContactSaveRequest DeleteMethod(Model.ViewModel.ContactSaveRequest methodsToDelete)
  {
      var contactMethodRepos = new Model.ContactMethodRepository();
  
      foreach (var contactMethod in methodsToDelete)
      {
          contactMethodRepos.Delete(contactMethod);
          return contactMethod;
      }
  }
  </code></pre>
  
  <p>This is my class defining a contact method</p>
  
  <pre><code>[JsonProperty("id")]
  public int ID { get; set; }
  
  [JsonProperty("contactID")]
  public int ContactID { get; set; }
  
  [JsonProperty("typeOfContactMethodID")]
  public int TypeOfContactMethodID { get; set; }
  
  [JsonProperty("text")]
  public string Text { get; set; }
  
  [JsonProperty("methodsToDelete")]
  public IEnumerable&lt;ContactMethod&gt; methodsToDelete { get; set; }
  </code></pre>
  
  <p><code>ContactSaverequest</code> class:</p>
  
  <pre><code>public class ContactSaveRequest
  {
      [JsonProperty("contact")]
      public Contact Contact { get; set; }
  
      [JsonProperty("contactMethods")]
      public IEnumerable&lt;ContactMethod&gt; ContactMethods { get; set; }        
  }
  </code></pre>
  
  <p>I have an array which pushes methods into it to be deleted (<code>methodsToDelete</code>). I am trying to use the <code>Delete</code> method on the array but keep getting the issue that <code>contactSaveRequest</code> doesn't contain a definition for <code>GetEnumerator</code>.</p>