title: How to make use of environment parameter passed to EntityFramework Core CLI
body: <p>Some of Entity Framework Core CLI commands accept <code>environment</code> parameter. For example <code>dotnet ef migrations list --environment &lt;env_name&gt;</code>.</p>
  
  <p>The assembly where I keep migrations is separate from data entities assembly, therefore I had to derive from <code>IDbContextFactory</code>.</p>
  
  <p>And here comes my question: is there a way to get the environment parameter passed to CLI from inside my <code>DbContextFactory</code> class? I need this to apply specific environment's connections strings.</p>
  
  <p>Thanks in advance.</p>