| Bug #89125 | DI Using IServiceCollection AddDbContext and AddDbContextPool Not Supported | ||
|---|---|---|---|
| Submitted: | 6 Jan 2018 2:01 | Modified: | 25 Jul 23:08 |
| Reporter: | Richard Collette | Email Updates: | |
| Status: | Verified | Impact on me: | |
| Category: | Connector / NET | Severity: | S4 (Feature request) |
| Version: | 6.10.5 | OS: | Any |
| Assigned to: | Assigned Account | CPU Architecture: | Any |
| Tags: | configuration, DbContext | ||

Description: Almost all providers support dependency injection configuration of a DbContext including the connection string using code like: public void ConfigureServices(IServiceCollection services) { services.AddDbContextPool<SomeDbContext>(config => config.UseMySQL()); services.AddMvc(); } How to repeat: Create a .net core 2.0 WebApi application In Startup.cs set ConfigureServices to look similar to the above. Note that config.UseMySql() is not available.