|
|
|
|
|
by mattmanser
3059 days ago
|
|
I find myself using TryUpdateModel far more these days than relying on letting the controller bind automatically. It's one of those magic features that ultimately hides too much. Far too much can go wrong and the error get silently swallowed, plus having a parameterless constructor is rare for complex objects. So you end up with a model missing properties you need filled in if there's a validation error, extra work to make sure it's properly populated that should have happened in the constructor, which means code duplication. |
|