У меня есть следующий код:
public ActionResult Foo()
{
var a = "a";
return View(new FooModel { A = a});
}
[HttpPost]
public ActionResult Foo(....)
{
// I need to set all the values of the ViewModel again, not to get a null exception in the view
return View(new FooModel { A = a});
}
Так, как я могу сохранить это СУХОЙ и не повторять вещи, которые я уже сделал?