I have ConsoleApplication on .NET Core and also i added my DbContext to dependencies, but howewer i have an error:
Unable to create an object of type \'My
I resolve this issue by this way:
public DbSet Posts { get; set; }
public DbSet Votes { get; set; }
public MyContext(DbContextOptions options) : base(options) { Database.EnsureCreated(); }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.ApplyConfigurationsFromAssembly(typeof(MyContext).Assembly);
}