title: How to pass connection string to UnitOfWork project from startup.cs asp.net core
body: <p>I created constructor in <code>AppDbContext</code> and context is implement in <code>UnitofWork</code> which pass string to context but how can I pass connection string to at <em>startup.cs</em> when I register <code>unitofwork</code>. <code>Repository</code> and <code>UnitOfWork</code> are in different project </p>
  
  <p>Following is my code,</p>
  
  <p>connection string to constructor</p>
  
  <pre><code>private readonly string _connection;
  public AppDbContext(string connection) 
  {
  
      _connection=connection;
  
  }
  </code></pre>
  
  <p>UnitOfWork constructor    </p>
  
  <pre><code>public UnitOfWork(string connection)
  {
      _context =  new AppDbContext(connection);
  }
  </code></pre>
  
  <p>in <em>StartUp.cs</em>, can I pass the connection string below, reading from <em>appsettings.json</em>?</p>
  
  <pre><code> services.AddTransient&lt;IUnitOfWork, UnitOfWork&gt;();
  </code></pre>