这个旧项目的示例结构。
public class Customs
{
[Key,Required, Column(Order = 0)]
public string DeclarationNo { get; set; }
[Key, Required, Column(Order = 1)]
public string ReceivedControlNo { get; set; }
[Key, Required, Column(Order = 2)]
public string MasterBL { get; set; }
public string CustomsDetail {get;set;}
public virtual CustomsManifest Manifest { get; set; }
}
public class CustomsManifest
{
[Key,Required, Column(Order = 0)]
public string ReceivedControlNo { get; set; }
[Key,Required, Column(Order = 1)]
public string MasterBL { get; set; }
public string ManifestDetail {get; set; }
public virtual Customs Customs { get; set; }
}
如何与2键建立关系。有可能吗?
我需要加入海关和关键的钥匙。 CustomsManifest是关系的零或一个