-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
When using the extension method to find configuration files, this error occurs:
[16:22:36 INF] Seeding Database...catalogContext
[16:22:36 ERR] The entity type 'ImageBanner' requires a primary key to be defined. If you intended to use a keyless entity type, call 'HasNoKey' in 'OnModelCreating'. For more information on keyless entity types, see https://go.microsoft.com/fwlink/?linkid=2141943.
Relevant code from AppDbContext:
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.ApplyAllConfigurationsFromCurrentAssembly(); // causes problems
// alternately this is built-in to EF Core 2.2
//modelBuilder.ApplyConfigurationsFromAssembly(Assembly.GetExecutingAssembly());
}Using the built-in ApplyConfigurationsFromAssembly version works fine.
Metadata
Metadata
Assignees
Labels
No labels