Answer the question
In order to leave comments, you need to log in
How to register DbContext in EntityFrameworkCore in Autofac?
Good afternoon, colleagues.
Tell me how to register DbContext in EntityFrameworkCore?
Test project - TestCore
Error: Cannot resolve parameter 'Microsoft.EntityFrameworkCore.DbContext context' (passed parameters, still didn't help)
Answer the question
In order to leave comments, you need to log in
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
var connectionString = "Data Source=localhost;Initial Catalog=TestCore;Integrated Security=true";
optionsBuilder.UseSqlServer(connectionString);
base.OnConfiguring(optionsBuilder);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question