c# - How to set up 1..0-1 relationship using Code-first? -
based on article, and:
- using fluent api, and
- 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
Post a Comment