Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Complete examples using MVC2, EF4, and Repository Pattern with true SoC [closed]

I'm having trouble finding examples of ASP.NET MVC solutions that use EF4 in their repository while adhering to SoC.

Can anyone provide me with references to examples (open source, books, tutorials, articles, etc.) that demonstrate the following?

  • ASP.NET MVC 2
  • Entity Frameworks 4
  • Repository Pattern
  • Separation of Concerns (i.e. BL does not explicitly reference anything)

In addition to the core technologies/patterns/principals above, I would really appreciate it if the examples also covered these topics so I could see how they might change with EF4:

  • Multi-project solutions
  • Dependency Injection (Windsor)
  • Unit Tests
  • Unit of Work

One example covering the use of context interfaces is on Stack Overflow but I'm seeking something a little more comprehensive if it exists.

Many thanks!

like image 733
Mayo Avatar asked Sep 16 '10 15:09

Mayo


3 Answers

I came across the Microsoft - Domain Oriented N-Layered .NET 4.0 App Sample while looking for DDD examples:

This project implements a very simple business scenario, but it is quite end to end complete regarding DDD N-Layered Architecture style , showing DDD design patterns implementation (Repository, UoW, Entity, Aggregate, Value-Object, etc.), using .NET 4.0 'technology wave' (EF 4.0, WCF 4.0, etc.) and several Archetypes (we'll be growing to many different clients, starting from WPF 4.0 , Silverlight 4.0 , and going to ASP.NET MVC , OBA , Windows Phone during the next future).

I haven't had a chance to look through the code in depth, but it looks like a very comprehensive example hitting on all the points you list, although it looks like they use Unity for IoC.

Hope this helps.

like image 189
Jeff Ogata Avatar answered Nov 13 '22 07:11

Jeff Ogata


This is a very comprehensive article on Testability and the Entity Framework 4. It also discusses the repository pattern in great detail and even compares differences in different possible implementations of the Repository pattern (including Unit of Work). it also covers depenency injection. it does all this in the context of an MVC 2 app.

like image 40
Steve Michelotti Avatar answered Nov 13 '22 08:11

Steve Michelotti


Try watching the video at http://tekpub.com/production/starter and downloading the sample (link is available in the same page). It uses Ninject to IoC byt may help you with some of the topics you posted anyway.

like image 41
Retired_User Avatar answered Nov 13 '22 06:11

Retired_User