简体   繁体   中英

One2One relationship in Entity Framework

I am interested how to achieve one 2 one relationship between two tables using Entity Framework without using Fluent API, just using Data Annotations. Is this possible ? If yes could someone give me a sample code for this ?

Thanks in advance!

也许ForeignKeyAttribute(FW 4.5)会为您提供帮助。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM