I currently have 2 projects setup - the first ia a .NET Core 3.0 API project and the second one is as well but just contains the EF Core models.
I have added a model called Country to the model project and when I try to add a API controller using EF actions for the Country model, I get the following error:
Unable to create an object of type 'ApplicationDbContext'. For the different patterns supported at design time, see https://go.microsoft.com/fwlink/?linkid=851728 StackTrace: at Microsoft.EntityFrameworkCore.Design.Internal.DbContextOperations.<>c__DisplayClass13_3.b__13() No parameterless constructor defined for type 'MyProject.Domain.Data.ApplicationDbContext'.
The ApplicationDbContext class is as follows:
public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
{
public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options)
: base(options)
{
}
public DbSet<Country> Countries { get; set; }
}
I also get the following error message after the previous one:
No parameterless constructor defined for type 'MyProject.Domain.Data.ApplicationDbContext'
Any idea on what I am missing? I can add migrations and they run fine. I just can't add any API controllers to my API project.