存储库模式Where和轻量级ORM
对于我的 IRepository,我希望:
- 让它可以被像 dapper、petapoco、massive 等这样的 micro-orm 使用...对于 SPEED
- 拥有在服务器上运行的 where 子句,希望使用 Expression/IQueryable 样式(其中也非常可互换)
是否可以两者兼得?你会如何为 micro orms 编写 IRepositoryWhere ?微型 ORM 是否适合大到需要存储库的项目?
我需要速度和交换能力。如果没有一个好的地方,我的存储库模式就毫无价值,对吗?
For my IRepository, i would like:
- To have it be usable by a micro-orm like dapper, petapoco, massive etc... for the SPEED
- To have where clauses that get run on the server, hopefully using Expression/IQueryable style (which is also very swappable)
Is it possible to get both? How would you write an IRepository Where for micro orms? Are micro ORMs good for projects big enough to necessitate Repositories?
I need speed and swap-ability. Without a good where my repository pattern is worthless, right?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您喜欢像 POCO 类这样看起来不错的东西,并且还想要 MicroORM 的速度,那么您必须检查 ServiceStack OrmLite< /a>.甚至您也可以使用 Massive 或 Dapper。只是使用它就会有所不同。
但有一件事是肯定的,代码会更少,速度会更慢。如果您需要任何代码片段,请告诉我。只需浏览 github 站点,就会有所帮助。
If you like things looking good like POCO classes, and also want speed of MicroORM, than you must check, ServiceStack OrmLite. Even you can use Massive or Dapper. Just a use of that will be different.
But one thing is for sure, Code will be less and speed is like anything. Do let me know if you need any code snippet. Just go through the github sites, that will help.