|
|
|
|
|
by mattmanser
4620 days ago
|
|
Unfortunately you've misunderstood MVC. None of that code belongs in the controller. Your 'typical' controller is anything but. All that code belongs in the model. Your controllers should have zero LINQ statement. You should do all of the validation in the model and the validation failures should returned in a List. This stuff's been in MVC for years: http://weblogs.asp.net/scottgu/archive/2010/01/15/asp-net-mv... When people talk about 'light' or 'skinny' controllers, this is what they're talking about. So we're not doing MVC wrong, you've just developed bad habits from bad microsoft examples, work with some experienced Devs so they can teach you how to do it correctly. |
|
That said, your points are good, and I agree, based on what I have learned myself to this point.
:-)