且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用Linq to Sql和C#的存储库模式的实现示例

更新时间:2023-02-13 15:10:12

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.