Design a site like this with WordPress.com
Get started

The entity type ‘DisplayDetails’ 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.

Solution: If you intend to create a table without a primary key in the database just add [Keyless] before class name as follows: [Keyless] public class DisplayDetails { } You might come across the error when you add "keyless" that is because you also need to add this using statement: using Microsoft.EntityFrameworkCore;

Blog at WordPress.com.

Up ↑