Saturday, 15 May 2010

c# - create one to one REFERENCES in EF designer? -



c# - create one to one REFERENCES in EF designer? -

i have 2 tables employees , aspnetuser. i'm trying create associate between tables employees , aspnetuser in ef designer in vs2013 using email employees , username(email).i createunique constraint on employees email have unique email each employee have problem when click ok have error message "verify navigation property name unique" have couple of problems.

1-i seek utilize id asp.net membership varchar(128) not guid because of have alter employees id int varchar(128) table have relation employees.

2- how solve problem apically don't have access database because easy thing create references constraint between users , employees don't have access database because of company ?

the error tells you're introducing new navigation properties names exist in types you're trying associate. in text boxes below navigation property checkbox you're not selecting properties. you're entering names new ones you've indicated want create checking checkboxes.

this not going work. if types of primary keys different, ef won't able create "soft" association between them (where "soft" association 1 not backed hard foreign key in database).

you alternative manually join 2 tables whenever need info both.

c# asp.net entity-framework database-design visual-studio-2013

No comments:

Post a Comment