Wednesday, July 13, 2022

Nuget PMC Error while adding migration: The entity type 'Employee' 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.

 This happens when you dont define primary key for an entity type. 


Define a primary key either explicitly or implicitly. 

No comments:

Post a Comment

 using Microsoft.AspNetCore.Mvc; using System.Xml.Linq; using System.Xml.XPath; //<table class="common-table medium js-table js-stre...