2
當我們使用Asp.net Boiler plate時,你能告訴我如何設置與下面提到的模型的1:1關係嗎?提前致謝。實體框架與Asp.net鍋爐板的1對1關係
注:我看到this nice answer關於EF 1至1 relationship.But不幸的是我不知道如何與鍋爐plate.B'cos PK自動從ABP.On我的情況採取設置其中兩個表都有int
PK。
注2:這裏的屬性和地址模型具有1:1的關係。
地產模式
[Table("IpProperties")]
public class Property : FullAuditedEntity
{
public virtual bool Vacant { get; set; }
public virtual Address Address { get; set; }
}
地址模式
[Table("IpAddresses")]
public class Address : FullAuditedEntity
{
[Required]
[MaxLength(MaxLength)]
public virtual string StreetNumber { get; set; }
public virtual Property Property { get; set; }
}
感謝您的支持:) – Sampath