Reputation: 155
I have Entity Framework 6 Tools checked in my visual studio 2019 installer under "Individual Components" like so:
But when I right click, on my DbContext Class > Entity Framework > "View Entity Data Model (Read Only)" I get the error "a constructible type deriving from DbContext could not be found in the selected file". I'm aware that other people have asked about this error on SO, but for less up to date versions of VS.
Here's the code for my DbContext:
using Microsoft.EntityFrameworkCore;
using youShouldCheckOutThisBand.Entities;
namespace youShouldCheckOutThisBand.Contexts
{
public class AppContext: DbContext
{
public AppContext()
: base()
{
}
public DbSet<ImageEntity> Images { get; set; }
public DbSet<TrackEntity> Tracks { get; set; }
public DbSet<AlbumEntity> Albums { get; set; }
public DbSet<ArtistEntity> Artists { get; set; }
}
}
Upvotes: 0
Views: 525
Reputation: 1627
EF Core does not support visual designer for DB model similar to EF 6/5/....
Source : EF Core - Existing Database on www.entityframeworktutorial.net
Upvotes: 1