title: How to pass list of class object in get method - asp.net core 2.1
body: <p>I am trying to pass list of class object in my ASP.Net Core 2.1 Controller. I am getting empty object with count 0. I have used attribute <code>[FromQuery], [FromRoute]</code> but the result remain same. My parameter class is as follows:</p>
  
  <pre><code>public class Employee
  {
      public int EmployeeCode { get; set; }
      public int EpfNumber{ get; set; }
  }
  </code></pre>
  
  <p>I am trying to get the list of Employee Class in my Controller like this:</p>
  
  <pre><code>[Route("[action]")]
  public async Task&lt;ActionResult&lt;int&gt;&gt; GetEmployeeByEmpCode([FromQuery]List&lt;Employee&gt; emp)
  {
      //----------Doing my stuff.
      return Ok(1);
  }
  </code></pre>
  
  <p>Here in the <code>emp</code> parameter I am getting empty list. By googling the issue, I got that I need to use <code>[FromUri]</code>. But the <code>[FromUri]</code> is used in Asp.Net WebApi 2, not asp.net core. If I simply add list of string as parameter then it works. The problem is with the class object as peremeter. </p>
  
  <p>My question is how to pass list of class object as peremeter in Asp.Net Core 2.1 controller?</p>