0
我有3個實體,中間的一個連接外部的兩個。 我有一個RequestType1的值,我需要的是使用Linq的RequestField1的相應值。對於RequestType1值爲2Linq to entities導航屬性的複雜性
我的課是這樣
public partial class RequestField
{
public int RequestID { get; set; }
public int RequestField1 { get; set; }
public string FieldContents { get; set; }
public virtual FieldDefinition FieldDefinition { get; set; }
public virtual Request Request { get; set; }
}
public partial class FieldDefinition
{
public FieldDefinition()
{
this.RequestFields = new HashSet<RequestField>();
this.RequestTypes = new HashSet<RequestType>();
}
public int RequestField { get; set; }
public string FieldName { get; set; }
public string FieldReference { get; set; }
public virtual ICollection<RequestField> RequestFields { get; set; }
public virtual ICollection<RequestType> RequestTypes { get; set; }
}
public partial class RequestType
{
public RequestType()
{
this.Requests = new HashSet<Request>();
this.FieldDefinitions = new HashSet<FieldDefinition>();
}
public int RequestType1 { get; set; }
public string TypeDescription { get; set; }
public virtual ICollection<Request> Requests { get; set; }
public virtual ICollection<FieldDefinition> FieldDefinitions { get; set; }
}
在數據庫中,我有一個表中有2個主鍵,我在其中創建了它成爲導航屬性的實體。 – Ernie
你在說什麼餐桌? – IronMan84
我有一個包含2個主鍵RequestType和RequestField的表。 – Ernie