简体   繁体   English

C#中的存储库模式

[英]Repository Pattern in C#

I am trying to figure out the repository pattern for .NET. 我试图弄清楚.NET的存储库模式。 I think I have a pretty decent understanding of it, but I still don't feel comfortable using it. 我想我对它有一个相当不错的理解,但我仍然觉得使用它感觉不舒服。

I have googled for this topic, but found some advanced topics along with the repository pattern. 我搜索了这个主题,但发现了一些高级主题以及存储库模式。 What I am looking for is a basic knowledge of the concept, then I can build on it. 我正在寻找的是这个概念的基本知识,然后我可以建立它。 With that said, can I get a recommendation of some good articles on the repository pattern? 话虽如此,我是否可以获得有关存储库模式的一些好文章的建议?

Thanks 谢谢

I recommend start by Fowler's definition 我建议从福勒的定义开始

This concrete implementation could help you as well : ) 这个具体的实现也可以帮助你:)

请参阅C#中的Repository模式教程的答案。

Ayende's Rhino.Commons has a decent implementation. Ayende的Rhino.Commons有一个不错的实现。

I also benefitted from reading "Domain-Driven Design" by Eric Evans, which gives a good foundation of understanding the motivations behind Repository. 我还从阅读Eric Evans的“领域驱动设计”中受益,这为理解Repository背后的动机提供了良好的基础。

Have a look at following Article. 看看下面的文章。

I'm in exactly the same position you were in. I found this Remondo.net blog post particularly useful. 我的位置与你完全一样。我发现这个Remondo.net博客文章特别有用。 It walks through the implementation of a basic repository: 它介绍了基本存储库的实现:

The Repository Pattern Example in C# C#中的存储库模式示例

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM