有人可以解释为什么以下模型在LogIn操作方法中无效吗?我该怎么做才能解决它?
public class EmployeeViewModel
{
public int? EmployeeId { get; set; }
public string EmployeeName { get; set; }
public string EmployeeEmailId { get; set; }
}
public ActionResult Index()
{
EmployeeViewModel evm = new EmployeeViewModel();
evm.EmployeeEmailId = "sdf@gmail.com";
return LogIn(evm);
}
public ActionResult LogIn(EmployeeViewModel modelEnt)
{
if (ModelState.IsValid) //Invalid Employee Id
{
...
}
}