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: