title: Mapping private attributes of domain entities with Dapper dot net
body: <p>In most of my projects I use nHibernate + Fluent mapping and recently I've started to play around with Dapper to see if I can move read operations to it. </p>
  
  <p>I follow DDD approach so my domain entities do not have any public setters. For example:</p>
  
  <pre><code>public class User
  {
      private int _id;
      private string _name;
      private IList&lt;Car&gt; _carList;
  
      protected User(){} // Fluent Mapping
  
      public User(string id, string name)
      {
          // validation 
          // ...
          _id = id;
          _name = name;
      }
  
      public int Id{ get {return _id;} }
      public string Name { get {return _name;} }
      public IList&lt;Car&gt; CarList { get {return _carList;}}         
  }
  
  public class Car
  {
      private int _id;
      private string _brand;
  
      protected Car(){} // Fluent Mapping
  
      public Car(string id, string brand)
      {
          // validation 
          // ...
          _id = id;
          _brand= brand;
      }
  
      public int Id{ get {return _id;} }
      public string Brand { get {return _brand;} }
  }
  </code></pre>
  
  <p>With Fluent nHibernate I'm able to reveal members for mapping:</p>
  
  <pre><code>Id(Reveal.Member&lt;User&gt;("_id")).Column("id");
  Map(Reveal.Member&lt;User&gt;("_name")).Column("name");
  </code></pre>
  
  <p><strong>Is there a way to map my domain entities with Dapper? If so, how?</strong></p>