我有两个POCO课程
public class Order
{
int id;
string code;
int? quotationId; //it is foreign key
public int Id{get;set;}
public string Code{get;set;}
public int? QuotationId{get;set;}
Quotation quotation;
public virtual Quotation Quotation { get; set; }
....
}
public class Quotation
{
int Id;
string Code;
public int Id{get;set;}
public string Code{get;set;}
Order order;
public virtual Order Order { get; set; }
....
}
每个订单可能由一个或零个报价组成,并且每个报价都可能导致一个订单,所以我有一个“一或零”到“一或零”的关系,我该如何首先通过fluent API在EF代码中实现呢?
长风秋雁
HUWWW
相关分类