There are two main aspects to application development in this new world of ASP.NET 5.
- Dependency Injection. What services will be required to launch our application?
- Application / query pipeline. In fact, we answer the question "What to do when a request hits the server."
Because of these two main problems, then two mechanisms of binding to the system arise.
First, UseMVC is how your application can say that I want MVC to participate in the request processing phase at the "this" point. This is essentially a shortcut for MVC middleware.
Secondly, AddMvc is how your application says that you want the MVC services available for the system (necessary for UseMVC ) to work correctly. Therefore, if you try to make UseMVC without adding the corresponding MVC services, the call will throw. Note that this adds the appropriate MVC services to the DI container.
I hope this is the answer to your questions, for more information about this you can find out http://www.asp.net/vnext for more general information. Something more specific / video I spoke some time ago at the Orchard conference, where I go to a few main parts https://www.youtube.com/watch?v=kqgIByKn9Wk
Note. I talked a little, some concepts are outdated / may change, but the basic concepts are the same.
source share