title: Passing Object from JavaScript to C#
body: <p>Good Evening,
  Right now I have a project with back-end written in C#. I am trying to connect it to front-end JavaScript code. the method inside my js file:</p>
  
  <pre><code>var people = [{name: "Sam", age: 40}, {name: "Vivian", age: 20}]    
  foo = function () {
              var url = "/api/folder/foo";
              $http({
                  method: 'GET', url: url, params: {
                      version: "7.1",
                      ppl: people  &lt;---- the passing that causes error
                  }
              }).success(function (data, status, header, config) {
                  console.log("success!");
              }).error(function (data, status, header, config) {
                  alert("server error");
              });
          };
  </code></pre>
  
  <p>That is calling C# code:</p>
  
  <pre><code>    [HttpPost]
      [ActionName("foo")]
      public List&lt;LoopItem&gt; foo(String version, List&lt;Person&gt; ppl){
          System.Diagnostics.Debug.WriteLine("Success!");
          return repository.foo( version, ppl);
      }
  </code></pre>
  
  <p>As you can see, my C# code takes as a parameter a string and List of Person, which is a simple object:</p>
  
  <pre><code>public class Person
  {
      public String name { get; set; }
      public Int32 age { get; set; }
  }
  </code></pre>
  
  <p>Although in my js code I tried to mimic the C# class Person, and created a list of objects with the same keys, the C# function does not seem to recognize the passed list of objects as list of Person from some reason. As the result, none of the debug "success" gets printed. Does anyone know how to solve this problem?</p>