This project is read-only.

Request for modification

Jul 11, 2013 at 10:41 PM
Edited Jul 11, 2013 at 10:48 PM

I may have mentioned this before, but it just bit me again, wasting another couple of days tracking it down.

On line 382 in the Mvvm.Controller.cs file in the Execute method, you check for the expected parameters. At this point, you have already found the matching method.

The problem is that the value passed in the Model via the following code:
Controller.Action("Customer", "Edit", new { Id = SelectedCustomer.key.ToString() }
And the Edit method in the controller was:
public ActionResult Edit(string key)
decimal realKey = 0m;
decimal.TryParse(key, out realKey );
return View( new CustomerEditViewModel(realKey) );
Since the parameter (key) did not match the argument (Id), it was skipped. And then the Action was never executed, with no hint of why.

Could you please modify the code on line 390 to add an ELSE statement to respond if the parameters and arguments don't match? Then, if in a developer mode, you could post a warning, use a debug.assert (or whatever, lots of options) so the developer has some idea of what is wrong.

While I will modify the code for now, the very next update will wipe out my changes, so I am hoping you can.


Jul 12, 2013 at 1:23 AM
You mean right where the TODO comment is about raising an error? :-)

Seriously: You are right. This should be more obvious. I added a detailed exception. This will be in the next build which due soon.