我想使用 redirectToAction() 方法传递多个对象。以下是我要重定向到的操作结果。
public ActionResult GetEmployees(Models.Department department, Models.Category category, Models.Role role)
{
return View();
}
我想做类似下面的事情
public ActionResult test()
{
Models.Department dep = new Models.Department();
Models.Category cat.......etc
return RedirectToAction("GetEmployees", dep, cat, role); }
任何帮助将不胜感激 - 谢谢
更新
我可以使用类似的东西吗
Models.Department dep = new Models.Department() { DepId = employee.DepartmentId };
Models.Category cat = new Models.Category() { CatId = employee.JobCategoryId };
Models.Role title = new Models.Role() { RoleId = employee.JobTitleId };
return RedirectToAction("GetEmployees", new { department = dep, category = cat, role = title });