Make configuring dbcontext topic more helpful
Helpfulness rating is very low.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: a47bf610-692d-9d40-d85f-aec1e2a87a07
- Version Independent ID: 3c94634a-4b17-bc13-7436-0c61aea03ab6
- Content: Configuring a DbContext - EF Core
- Content Source: entity-framework/core/miscellaneous/configuring-dbcontext.md
- Product: entity-framework
- GitHub Login: @rowanmiller
- Microsoft Alias: divega
Aside from general requests for more examples, there's only one comment from the feedback control; it indicates more context is needed for one of the code snippets. "UseSqlite does not exist on options when typing options.UseSqlite"
In order for the options.UseSqlite or options.UseSqlServer choices to appear on the intellisense menu, the "using Microsoft.EntityFrameworkCore;" must be added. Just ran into this minutes ago, and found this.
What about the repository pattern? The repository uses IRepository interface, and coupling that with the DbContext and the initialisation can be non-trivial as far as dependency injection is concerned?
Today, while experimenting with some of the code, I was tripped up by the fact that there are different "options". One is the parameter of AddDbContext, and another one is the parameter of UseSqlite (and others). The first has the UseSqlite method and the second has options specific to SQLite.
Also AddDbContext<TContextService,TContextImplementation> should be documented