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