title: Dapper: How to return selected columns?
body: <pre><code>public List&lt;Customer&gt; getCustomer() 
  {
      using (IDbConnection con=DapperConnection())
      {
          string sql = "Select * from Customer";
          return con.Query&lt;Customer&gt;(sql).Select(x =&gt; new { x.Id, x.LastName })
                      .ToList();
      }
  }
  
  class Customer 
  {
      public string Id { get; set; }
      public string FirstName { get; set; }
      public string LastName { get; set;}
  }
  </code></pre>
  
  <p>Does anyone know how to return specific columns using dapper? What I am trying to achieve is to return just the <code>Id</code> and <code>LastName</code> as <code>List</code> so that I can bind them to my controls.</p>