0
我有幾個實體,如Customer
,Vendors
,Employee
的,我有另一個實體處理Transaction Head
,這裏檢查的定義:實體框架的多個對象的關係,以同一列
public class TransactionHead
{
public string DocumentNo { get; set; }
public DocumentType TransactionType { get; set; }
public Location From { get; set; }
public object To { get; set; }//customer, supplier, location, employee "will have a discount table "
public DateTime DocumentDate { get; set; }
public float GrossAmount { get; set; }
public float TotalDiscount { get; set; }
public float NetAmount { get; set; }
public int DetailRowCount { get; set; }
public bool IsActive { get; set; }
public bool IsDeleted { get; set; }
public User Created { get; set; }
public User Updated { get; set; }
public User Approved { get; set; }
public DocumentStatus DocumentStatus { get; set; }
public string ApprovalRemark { get; set; }
public string DocumentRemark { get; set; }
public DateTime CreatedTimeStamp { get; set; }
public DateTime UpdatedTimeStamp { get; set; }
}
,現在當我創建的遷移,它會自動忽略TransactionHead
實體的To
屬性。那麼解決方案是什麼?
感謝
**要**屬性的目的是什麼?爲什麼要命名**要**?爲什麼它是**對象**類型? –