title: Dapper mapping columns to entity properties?
body: <p>I'm using Dapper's Query&lt;> to search for a number of records:</p>
  
  <pre><code>public class Product
  {
      public int Id {get; set}
      public string Name {get; set}
      public int CategoryId {get; set}
  ]
  
  public IEnumerable&lt;Product&gt; GetProducts(int categoryId)
  {
      var connection = DataContext.Database.Connection;
  
      var sql = "SELECT * FROM products WHERE category_id = @categoryId";
  
      var result = connection.Query&lt;Product&gt;(sql, new { categoryId });
  
      return result;
  }
  </code></pre>
  
  <p>The query itself returns the requested records but each object in the list has empty fields.</p>
  
  <p>So how can I map the columns to the entity's properties? </p>
  
  <p>I would not like to add column aliases in the sql statement. Decorating the entity's properties is also not an option because the entities are generated by the EF designer.</p>