Dapper SqlMapperExtensions / Dapper.Contrib?
好像有一个DapperExtensions项目,但是Dapper项目中还有一个SqlMapperExtensions类。有重叠吗?其中一个比另一个更受青睐吗?我找不到有关 Dapper.Contrib 的任何文档。
There seems to be a DapperExtensions project, but there is also a SqlMapperExtensions class in the Dapper project. Is there overlap? Is one preferred over the other? I can't find any documentation on Dapper.Contrib.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Dapper.Contrib
是程序集名称: https:/ /github.com/StackExchange/Dapper/tree/master/Dapper.ContribSqlMapperExtensions
是包含 contrib 方法的静态类Dapper.Contrib
:https:/ /github.com/StackExchange/Dapper/blob/master/Dapper.Contrib/SqlMapperExtensions.cs最好的文档是测试用例类: https://github.com/StackExchange/Dapper/ blob/master/Dapper.Tests.Contrib/TestSuite.cs
Dapper.Contrib
is the assembly name: https://github.com/StackExchange/Dapper/tree/master/Dapper.ContribSqlMapperExtensions
is the static class containing the contrib methods withinDapper.Contrib
: https://github.com/StackExchange/Dapper/blob/master/Dapper.Contrib/SqlMapperExtensions.csThe best documentation is the test case class: https://github.com/StackExchange/Dapper/blob/master/Dapper.Tests.Contrib/TestSuite.cs
很久以前,在与 Sam 讨论后,我编写了第一个 Dapper.Contrib。我不知道扩展包的详细信息,它们似乎或多或少做了相同的 CRUD 操作,但在某些情况下,Contrib 包可能会更快一些,因为它有一个用于查询和接口的内置缓存基于 POCO 的内部“脏”跟踪。从测试代码中摘录:
Contrib 没有 Extensions 拥有的漂亮的谓词系统。 注意这里有一个关于 Dapper.Contrib 的好帖子 Dapper.Rainbow VS Dapper.Contrib
I wrote the first Dapper.Contrib a long time ago after some discussion with Sam. I don't know the details of the Extensions-package and they seem to do the same CRUD-thing more or less but the Contrib-package may be somewhat faster in some scenarios because it has a built in cache for both queries and for interface-based POCOs with an internal "is dirty" tracking. Snipped from the test-code:
Contrib does not have the nice looking predicate system which Extensions has. NOTE there is a good thread on Dapper.Contrib here Dapper.Rainbow VS Dapper.Contrib
我认为 user1003841 指的是 https://github.com/tmsmith/Dapper-Extensions。
作者是 Thad Smith 和 Page Brooks - 所以这不是 Sam Saffron 的作品。项目页面显示“这个库是 Dapper.Contrib 的独立项目”。
I think user1003841 was referring to https://github.com/tmsmith/Dapper-Extensions.
The authors are Thad Smith and Page Brooks - so it's not Sam Saffron's work. The project page says "This library is a separate effort from Dapper.Contrib".