私は次のコードを持っています:
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});
}
では、どうすればそれを乾いた状態に保ち、すでに行ったことを繰り返さないことができますか?