私はこのようなモデルを持っています:
public class EquipmentEmployee
{
public int EquipmentEmployeeID { get; set; }
public int EmployeeID { get; set; }
public Employee Employee { get; set; }
public int EquipmentID { get; set; }
public Equipment Equipment { get; set; }
public int RequisitionID { get; set; }
public Requisition Requisition { get; set; }
public DateTime From { get; set; }
public DateTime To { get; set; }
public string Comment { get; set; }
}
コントローラー、リポジトリー、およびビューの作成に Mvc スキャフォールディングを使用しています。「to」と「RequisitionID」の値がないため、作成ビューの内部で POST できません。[必須]は付けていません。これは可能ですか?POSTして、これら2つをnullにするには?