开发者

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

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

Closed 7 years ago.

Improve this question

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 the开发者_运维百科y 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!


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.


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜