I have Web API in ASP .NET Core. When I add a db context in Startup.ConfigureServices
:
public void ConfigureServices(IServiceCollection services)
{
services.AddDbContext<FixturesContext>(
options => options.UseSqlServer(Configuration.GetConnectionString("FixturesDatabase")));
services.AddControllers();
}
I see the number of services in the "services" container raises by three, I think those are:
- FixturesContext
- DbContextOptions
- DbContextOptions`1
I am curious what is "DbContextOptions1"
? Does anyone know? I have tried googling it but not satysfying result. My goal is to replace original context with in-memory (to run integration tests without original database), so I'm deleting db context and its options and adding in-memory context instead of them.
DbContextOptions<FixturesContext>
– Nkosi Jan 12 '20 at 21:32