i'm trying to use migrations, but I have the following issue
$ dotnet ef migrations add InitialMigration
No DbContext was found in assembly 'VirtualStore.Data'. Ensure that you're using the correct assembly and that the type is neither abstract nor generic.
Here, my Context class
using Microsoft.EntityFrameworkCore;
using VirtualStore.Mapping.Mapping;
namespace VirtualStore.Data
{
public class Context<T> : DbContext where T : Entity
{
public DbSet<T> Entity { get; set; }
public Context()
{
Database.EnsureCreated();
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
}
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseSqlServer("Data Source=DESKTOP-3UEM3PC;Initial Catalog=VIRTUALSTORE;Integrated Security=SSPI;");
base.OnConfiguring(optionsBuilder);
}
}
}
And My Solution
Anyone knows what can I do, to use Migrations with this Architecture ?