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



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

package manager console:

one or more validation errors detected during model generation:

p6.dal.password: : entitytype 'password' has no key defined. define key entitytype. password: entitytype: entityset 'password' based on type 'password' has no keys defined.

class password:

public class password { [key] public int passwordid { get; set; } public string passwordname { get; set; } public string isvalid { get; set; } public virtual person person { get; set; } }

try using -force this:

update-database -verbose -force -configurationtypename configuration

you can set instead of "configuration" configuration name.

there's chance reply here help you:

entity framework 6.1 delete column

entity-framework asp.net-mvc-5

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -