Answers for "InvalidOperationException: The entity type 'AspNetUserLogin' 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"

4

The entity type 'IdentityUserLogin<int>' requires a primary key to be defined. If you intended to use a keyless entity type call 'HasNoKey()'

protected override void OnModelCreating(ModelBuilder modelBuilder)
{
  base.OnModelCreating(modelBuilder);
}
Posted by: Guest on October-21-2020

Code answers related to "InvalidOperationException: The entity type 'AspNetUserLogin' 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"

Browse Popular Code Answers by Language