Repository Pattern

本文摘自《Professional Test-Driven Development with C#: Developing Real World Applications with TDD》,介绍了仓储模式的基本概念,即所有数据访问操作都封装在仓储对象中,业务域类通过它进行持久化工作。每种实体应有自己的仓储,且应具备相似接口和通用基类,以保持数据访问代码的DRY原则,简化学习过程。仓储模式可与多种数据访问技术结合使用,包括ADO.NET、Web服务和平文件存储。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

From "Professional Test-Driven Development with C#: Developing Real World Applications with TDD"

 

In short, the repository pattern states that all data access will be encapsulated into a repository object, which the business domain classes will use to perform any and all persistence work.

Each entity should have its own repository. However, repositories for different types should have similar interfaces and a common base class to help the data access code remain DRY and to make learning how to work with the repository easier.

Repositories can be used with any number of data access techniques, including ADO.NET, web services, and flat file storage.

 

转载于:https://www.cnblogs.com/BruceJing/archive/2012/05/21/2512362.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值