Riddick
Riddick

Reputation: 1318

Repository Pattern MVC4 EF5

Being fairly new to MVC4, ASP.NET and Entity Framework, I've been looking into the use of the repository and unit of work patterns, and I'd like to verify my understanding.

Am I right in thinking that the DBContext used within EF5 CodeFirst acts as a unit of work?

In this case, is there any point in implementing repositories?

Or should I use:

Model - Repository - ViewModel - Controller - View?

Upvotes: 2

Views: 5787

Answers (2)

AlexSolovyov
AlexSolovyov

Reputation: 497

Here is some ideas, why you don`t need to use UoF in your MVC project.

UoW

Upvotes: 1

MattSlay
MattSlay

Reputation: 10015

Check out the MVC Scaffolding project on CodePlex:

http://mvcscaffolding.codeplex.com/

Also, here's a walk-through that shows a little intro on how to use it:

http://www.codeproject.com/Articles/468777/Code-First-with-Entity-Framework-5-using-MVC4-and

Upvotes: 5

Related Questions