Fine-tuning asp.net mvc

I really like the idea of ​​"one model in one model" Fubu MVC. The controller will look something like this.

public class MyController
    {
        public OutputModel MyAction(InputModel inputModel)
        {
            //..
        }
    }

and the service locator will automatically fill in all the necessary dependencies in the constructor.

This makes the controller very easy to test.

So my question is: how would you go about setting up asp.net mvc to provide this simplicity in controllers?

+3
source share
2 answers

What you are looking for is ControllerActionInvoker. You will have to implement your own and override / take over most of the work with the ASP.NET MVC pipeline.

, 2 ControllerActionInvokers: http://lostintangent.com/2008/07/03/aspnet-mvc-controlleractioninvoker-part-1/

http://lostintangent.com/2008/07/07/aspnet-mvc-controlleractioninvoker-part-2/

, Oxite Oxite, :

http://oxite.codeplex.com/SourceControl/changeset/view/30544

ControllerActionInvoker: http://oxite.codeplex.com/SourceControl/changeset/view/30544#442766

+2

ASP.NET MVC, , ModelBinder ActionResult .

0

Source: https://habr.com/ru/post/1705782/


All Articles