entity framework - How to use migrations after adding a Key attribute to a property? -


Package Manager Console:

One or more validation errors were detected during model:

p6.DAL.Password :: EntityType 'password' has no key defined. Define the key for this EntityType Password: EntityType: EntitySet is based on the 'password' type 'password' in which no key is defined.

class password:

  public class password {key} public entry password ID {get; Set; } Public string password name {get; Set; } Public string IsValid {get; Set; } Public Virtual Person (Received; Set; }}  

using -force in this way Try:

You can name your configuration name instead of "Configuration" .

  update-database-verbose -force-configurationTypeName 

One chance my answer will help you here:


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -