ASP.NET MVC Patterns

后端 未结 4 1160
一向
一向 2021-01-15 09:07

I am fairly new to MVC, but after playing with it (MVC 3/Razor), I am hooked.

I have a few questions:

1) What is the best, or most widely used pattern to dev

4条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-15 09:44

    I would defiantly say the repository pattern is used a lot. This pattern can be used with Dependency Injection. Using Dependency Injection makes Unit Testing a breeze because you can snap different repositories to an abstract repoistory. Check out http://ninject.org/ for a simple to use Dependecy injector for .NET.

    View Models should hold display data and transfer that data from the controller to the view. If you want to edit and display customer info, take a look at this

提交回复
热议问题