redirectToAction results in null model
- by Maslow
I have 2 actions on a controller:
public class CalculatorsController : Controller
{
//
// GET: /Calculators/
public ActionResult Index()
{
return RedirectToAction("Accounting");
}
public ActionResult Accounting()
{
var combatants = Models.Persistence.InMemoryCombatantPersistence.GetCombatants();
Debug.Assert(combatants != null);
var bvm = new BalanceViewModel(combatants);
Debug.Assert(bvm!=null);
Debug.Assert(bvm.Combatants != null);
return View(bvm);
}
}
When the Index method is called, I get a null model coming out. When the Accounting method is called directly via it's url, I get a hydrated model.