当前位置:网站首页>分享.NET 轻量级的ORM
分享.NET 轻量级的ORM
2022-07-05 10:12:00 【全栈程序员站长】
ORM
https://github.com/StackExchange/dapper-dot-nethttp://fluentdata.codeplex.com/https://github.com/toptensoftware/PetaPocohttps://github.com/schotime/NPocohttps://github.com/ServiceStack/ServiceStack.OrmLite
使用Dapper
1.已经在项目中使用了Dapper,感觉还行,基本可以满足需求 2.使用Dapper一段时间,AnsiStringFixedLength 与AnsiString区别 http://stackoverflow.com/search?page=1&tab=votes&q=dapper 3.扩展Dapper : https://github.com/tmsmith/Dapper-Extensions or Dapper.Rainbow VS Dapper.Contrib
影响执行计划
Ansi Strings and varchar
Dapper supports varchar params, if you are executing a where clause on a varchar column using a param be sure to pass it in this way:
Query<Thing>("select * from Thing where Name = @Name", new {Name = new DbString { Value = "abcde", IsFixedLength = true, Length = 10, IsAnsi = true });
List Support
Dapper allow you to pass in IEnumerable and will automatically parameterize your query.
For example:
connection.Query<int>("select * from (select 1 as Id union all select 2 union all select 3) as X where Id in @Ids", new { Ids = new int[] { 1, 2, 3 });
Will be translated to:
select * from (select 1 as Id union all select 2 union all select 3) as X where Id in (@Ids1, @Ids2, @Ids3)" // @Ids1 = 1 , @Ids2 = 2 , @Ids2 = 3
_db.Query<Users>("SELECT * FROM dbo.Users WHERE id IN @ids ",new { ids = IDs.ToArray()}).ToList();
Refer: Dapper.Rainbow VS Dapper.Contrib http://stackoverflow.com/questions/10030285/dapper-rainbow-vs-dapper-contrib Using Dapper QueryMultiple in Oracle http://stackoverflow.com/questions/18772781/using-dapper-querymultiple-in-oracle SELECT * FROM X WHERE id IN (…) with Dapper ORM http://stackoverflow.com/questions/8388093/select-from-x-where-id-in-with-dapper-orm 扩展Dapper https://github.com/tmsmith/Dapper-Extensions Any Question http://stackoverflow.com/search?page=1&tab=votes&q=dapper
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/109868.html原文链接:https://javaforall.cn
边栏推荐
- Tianlong Babu TLBB series - single skill group injury
- 驱动制造业产业升级新思路的领域知识网络,什么来头?
- NCP1342芯片替代料PN8213 65W氮化镓充电器方案
- 历史上的今天:第一本电子书问世;磁条卡的发明者出生;掌上电脑先驱诞生...
- Click the picture in the mobile browser and the picture will not pop up
- Interview: is bitmap pixel memory allocated in heap memory or native
- 5G NR系统架构
- mongoDB副本集
- Qt实现json解析
- Learning Note 6 - satellite positioning technology (Part 1)
猜你喜欢
AtCoder Beginner Contest 258「ABCDEFG」
How does redis implement multiple zones?
字节跳动面试官:一张图片占据的内存大小是如何计算
@SerializedName注解使用
How to plan the career of a programmer?
Universal double button or single button pop-up
Learning notes 5 - high precision map solution
AD20 制作 Logo
B站大量虚拟主播被集体强制退款:收入蒸发,还倒欠B站;乔布斯被追授美国总统自由勋章;Grafana 9 发布|极客头条...
【 conseils 】 obtenir les valeurs des axes X et y de la fonction cdfplot dans MATLAB
随机推荐
学习笔记5--高精地图解决方案
CSDN always jumps to other positions when editing articles_ CSDN sends articles without moving the mouse
@SerializedName注解使用
StaticLayout的使用详解
【小技巧】獲取matlab中cdfplot函數的x軸,y軸的數值
Design of stepping motor controller based on single chip microcomputer (forward rotation and reverse rotation indicator gear)
请问大佬们 有遇到过flink cdc mongdb 执行flinksql 遇到这样的问题的么?
Tianlong Babu TLBB series - questions about skill cooling and the number of attack ranges
La vue latérale du cycle affiche cinq demi - écrans en dessous de cinq distributions moyennes
Constraintlayout officially provides rounded imagefilterview
What is the most suitable book for programmers to engage in open source?
Workmanager Learning one
橫向滾動的RecycleView一屏顯示五個半,低於五個平均分布
php解决redis的缓存雪崩,缓存穿透,缓存击穿的问题
B站大量虚拟主播被集体强制退款:收入蒸发,还倒欠B站;乔布斯被追授美国总统自由勋章;Grafana 9 发布|极客头条...
Have you learned to make money in Dingding, enterprise micro and Feishu?
SAP UI5 ObjectPageLayout 控件使用方法分享
Workmanager learning 1
IDEA新建sprintboot项目
AD20 制作 Logo