I am building a simple ASP.NET Core web application so I used Entity Framework Core to generate the database for me, using a code-first approach.
I tried to add migrations, but I get this error :
No migrations configuration type was found in the assembly 'WeReadForYou'. (In Visual Studio you can use the Enable-Migrations command from Package Manager Console to add a migrations configuration).
So I tried to enable migrations, but then I get this error:
No context type was found in the assembly 'WeReadForYou
Enable migration error:
I spent hours to solve the problem, I found a lot of similar questions and solutions, but none of them worked me.
This is the code the DbContext
Class :
using System;
using Microsoft.EntityFrameworkCore;
namespace WeReadForYou.Models
{
public class AppDBContext : DbContext
{
public AppDBContext(DbContextOptions<AppDBContext> options) : base(options)
{
}
public DbSet<Book> Books { get; set; }
public DbSet<Author> Authors { get; set; }
public DbSet<Gender> Genders { get; set; }
public DbSet<Quote> Quotes { get; set; }
}
}