c# - Entity Framework 6 specific column mapping -


in sql, tell database foreign key constraint is.

but fluent ef6 apparently not have way me specify column use when binding collections.

is not possible tell dbmodelbuilder column bind relationships on? or demand primary key @ times?

table_person id int // pkey. multiple people records uniqueid int // unique person sometext varchar(256) // database therefore tracks changes this, since unique person can have many records (pkeys).

table_address id int //pkey fk_unique int // should map uniqueid of person, not pkey. line1 varchar(512) state varchar(64) etc 1 unique person has many records, , uniqueid (not pkey) has many associated addresses. actual structure far more complex that. looking way fundamentally...

would have icollection<address> addresses within persons model. enable such thing code-first migrations... seems impossible? yes add-migration , modify generated code/sql manually. doesn't defeat point? or common practice?


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -