没有LINQ或其他ORM的存储库模式? [英] Repository Pattern without LINQ or other ORM?

查看:123
本文介绍了没有LINQ或其他ORM的存储库模式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在不使用LINQ或其他ORM的情况下使用Repository模式是否有意义?我正在使用MONO编写一个应用程序并使用MySQL,正在考虑使用该资源库模式,但不能处理IQueryable。我正在考虑在存储库中暴露更多的方法,使得显而易见的是,使用存储库调用在db端发生过滤。任何建议,如果这是有效使用设计或任何其他设计想法?

Does it makes sense to use the Repository pattern without the use of LINQ or some other ORM? I am writing an application in MONO and using MySQL, was thinking of using the repositoy pattern but not going to be able to deal with IQueryable. I was thinking of just exposing more methods on the repository to make it obvious that filtering was going to happen on the db side with the repository call. Any suggestions if that is a valid use of the design or any other design ideas instead?

推荐答案

存储库根本没有什么与IQueryable。你在想什么是Rob Conory .net 3.5采用存储库模式,其实际上是一个数据代理模式。

Repository has nothing at all to do with IQueryable. What you are thinking of is the Rob Conory .net 3.5 take on the repository pattern, which is actually more of a data broker pattern.

存储库负责返回对象,并处理数据访问,以便您的其他应用程序可以保持无知。

A repository is responsible for returning objects, and deals with data access so that the rest of your application can remain ignorant of it.

您可以在 Martin Fowlers 网站

这篇关于没有LINQ或其他ORM的存储库模式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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