使用Linq to Sql和C#的存储库模式的实现示例 [英] Implementation example for Repository pattern with Linq to Sql and C#

查看:50
本文介绍了使用Linq to Sql和C#的存储库模式的实现示例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一个遵循我的ASP.net MVC应用程序的域驱动设计原则的存储库模式实现示例/资源。有没有人有一个很好的例子或可以共享的学习资源?项目已通过Linq到C#在SQL中实现了存储库。



http ://blog.wekeroad.com/



来源可用。



他不太做严格的DDD,但他的TDD通常会将他驱逐出该方向。一个警告是,他有多个没有聚合根的存储库,因此它与教科书中的示例相去甚远。此外,该存储库的早期实现返回了IQueryable,因此存储库上没有域边界,这是有关他的设计的大部分噪音的源头。


I am looking for a Repository pattern implementation example/resource that follows domain driven design principles for my ASP.net MVC application. Does anyone have a good example or learning resource that can be shared?

解决方案

It's not an uncontroversial implementation, but Rob Conery's web storefront project has implemented repository via Linq to Sql in C#.

http://blog.wekeroad.com/

Source is available.

He's not quite doing strict DDD, but his TDD is generally sending him out in that direction. The one caveat is that he has multiple repositories with no aggregate roots, so it's far from a textbook example. Also, earlier implementations of the repository returned IQueryable, so there were no domain boundaries on the repository, which is the source of most of the noise made about his design.

这篇关于使用Linq to Sql和C#的存储库模式的实现示例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆