[英]Create relation code First Entity Framework
I have a model: 我有一个模型:
public class Delivery
{
public Guid Id { get; set; }
public string Name { get; set; }
public Guid BusinessId { get; set; }
public virtual ICollection<PriceDisc> PriceDisc { get; set; }
}
public class PriceDisc
{
public Guid Id { get; set; }
public decimal Amount { get; set; }
public Guid BusinessId { get; set; }
}
How to create relation one to many between Delivery.BusinessId and PriceDisc.BuissnessId? 如何在Delivery.BusinessId和PriceDisc.BuissnessId之间创建一对多关系?
Thanks 谢谢
你已经创建了一个对他们之间的许多关系Delivery
的保持集合PriceDisc
在你的代码,以便为一个Delivery.BusinessId
你有收集PriceDisc.BusinessId
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.