title: Serializing an object with restsharp and passing it to WebApi not serializing list
body: <p>I have a a view model that looks like.</p>
  
  <pre><code>public class StoreItemViewModel
  {
      public Guid ItemId { get; set; }
      public List&lt;Guid&gt; StoreIds { get; set; }
      [Required]
      public string Description { get; set; }
      //[Required]
      //[DataMember(IsRequired = true)]
      public int ItemTypeId { get; set; }
  
  
  }
  </code></pre>
  
  <p>I have a small helper that using is using RestSharp.</p>
  
  <pre><code>public static IRestResponse Create&lt;T&gt;(object objectToUpdate, string apiEndPoint) where T : new()
      {
          var client = new RestClient(CreateBaseUrl(null))
          {
              Authenticator = new HttpBasicAuthenticator("user", "Password1")
          };
  
          var request = new RestRequest(apiEndPoint, Method.POST);
          //request.JsonSerializer = new JsonSerializer();
         // {RequestFormat = DataFormat.Json};
          request.AddObject(objectToUpdate);
         // clientJsonSerializer = new YourCustomSerializer();
          var response = client.Execute&lt;T&gt;(request);
          return response;
      }
  </code></pre>
  
  <p>When debugging the controller within my api</p>
  
  <pre><code> [HttpPost]
      public HttpResponseMessage Create([FromBody]StoreItemViewModel myProduct)
      {
          //check fields are valid
       .........
       }
  </code></pre>
  
  <p>myProducts products are all populated apart from the  public List StoreIds it always is returning a single reward with an empty Guid. Even if I have added 2 or more StoreIds</p>
  
  <p>I assume this is because I am doing something wrong with my Create helper within my application.</p>
  
  <p>Can anyone help with this its causing a major headache.</p>
  
  <p>The raw data sent to the webapi is looking like</p>
  
  <pre><code>ItemId=f6dbd244-e840-47e1-9d09-53cc64cd87e6&amp;ItemTypeId=6&amp;Description=blabla&amp;StoreIds=d0f36ef4-28be-4d16-a2e8-37030004174a&amp;StoreIds=f6dbd244-e840-47e1-9d09-53cc64cd87e6&amp;StoreId=d0f36ef4-28be-4d16-a2e8-37030004174a
  </code></pre>