How do you configure the DbContext when creating Migrations in Entity Framework Core?
问题 Is there way that dependency injection can be configured/bootstrapped when using Entity Framework's migration commands? Entity Framework Core supports dependency injection for DbContext subclasses. This mechanism includes allowing for configuration of data access outside of of the DbContext . For example, the following would configure EF to persist to a SQL server using a connection string retrieved from config.json ServiceCollection services = ... var configuration = new Configuration()