c# - How to set up 1..0-1 relationship using Code-first? -


based on article, and:

  1. using fluent api, and
  2. not having navigation property in dependent entity (ie. studentaddress)

is possible create 1..0-1 relationship?

something like...

modelbuilder.entity<student>().hasoptional(e => e.studentaddress).withrequired().map(ca => ca.mapkey(new string[] {"studentid"}); 

Comments

Popular posts from this blog

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -