「ユーザー」モデルと「入札」モデルがあります。
そしてもちろん、DateBaseの「Users」テーブルと「Bids」テーブル。(postgresテーブルの「Bid」列)
次のように1つの「ユーザー」フィールドをマップできます。
public int UserId { get; set; }
public virtual User User { get; set; }
しかし、異なる名前の3つの「ユーザー」フィールドをマップする方法がわかりません。
public int CreatorId { get; set; }//id of user in db table
public int ManagerId { get; set; }//id of user in db table
public int ExecutorId { get; set; }//id of user in db table
public virtual User Creator { get; set; }
public virtual User Manager { get; set; }
public virtual User Executor { get; set; }
私は何をすべきか?
public class Bid
{
public int BidId { get; set; }
public string Title { get; set; }
public string Text { get; set; }
public DateTime DateOfCreating { get; set; }
public DateTime DateOfProcessing { get; set; }
public DateTime DateOfExecution { get; set; }
//here is something incorrect
public int CreatorId { get; set; }
public int ManagerId { get; set; }
public int ExecutorId { get; set; }
public virtual User Creator { get; set; }
public virtual User Manager { get; set; }
public virtual User Executor { get; set; }
public bool IsProcessed { get; set; }
public bool IsExecuted { get; set; }
public bool IsExecutionConfirmed { get; set; }
}