title: how can force a generic class use T constructor with parameter?
body: <p>I have a Generic class like this :</p>
  
  <pre><code>public class Mapper&lt;TEntity, TDataAccess&gt;
      where TEntity : Common.IEntity
      where TDataAccess : DataAccess, new()
  {
      public TDataAccess DataAccess { get; set; } 
      public Mapper()
      {
          DataAccess = new TDataAccess();
      }
      /*
       * ...
       * */
  }
  </code></pre>
  
  <p>and data access is like this :</p>
  
  <pre><code>public class DataAccess
  {
      public DataAccess()
      {}
  
      public DataAccess(string tranName)
      {}
  
      // CRUD functionality and other data access staff
  }
  </code></pre>
  
  <p>and a inherited class form <code>DataAccess</code> :</p>
  
  <pre><code>public class UserDataAccess:DataAccess
  {
      public UserDataAccess():base(string.Empty)
      {
      }
      public UserDataAccess(string tranName):base(tranName)
      {
          // Something to do with user
      }
  }
  </code></pre>
  
  <p>and finally <code>UserMapper</code> from Mapper :</p>
  
  <pre><code>public class UserMapper : Mapper&lt;User,UserDataAccess&gt;
  {
      // Mapping entity properties with datarows columns
  }
  </code></pre>
  
  <p>now imagine that I need to send <code>tranName</code> to given <code>TDataAccess</code> in <code>UserMapper</code>. how can do this without changing <code>DataAccess</code> class ? I can't access the source of <code>DataAccess</code> and also Generics don't realize Types different constructor overloads.
  I know that I can have a property on <code>UserDataAccess</code> and fill it whenever I need, but I can't because of thread safety issue.</p>
  
  <p>The <code>User</code> class is a plain entity - it has only properties.</p>