当前位置:网站首页>Share Net lightweight ORM
Share Net lightweight ORM
2022-07-05 10:38:00 【Full stack programmer webmaster】
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
Use Dapper
1. Has been used in the project Dapper, Feeling ok , Can basically meet the needs of 2. Use Dapper A span ,AnsiStringFixedLength And AnsiString difference http://stackoverflow.com/search?page=1&tab=votes&q=dapper 3. Expand Dapper : https://github.com/tmsmith/Dapper-Extensions or Dapper.Rainbow VS Dapper.Contrib
Affect the implementation plan
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 Expand Dapper https://github.com/tmsmith/Dapper-Extensions Any Question http://stackoverflow.com/search?page=1&tab=votes&q=dapper
Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/109868.html Link to the original text :https://javaforall.cn
边栏推荐
- ByteDance Interviewer: how to calculate the memory size occupied by a picture
- TSQL–标示列、GUID 、序列
- SLAM 01.人类识别环境&路径的模型建立
- 【JS】数组降维
- Learning II of workmanager
- Learning Note 6 - satellite positioning technology (Part 1)
- uniapp
- 沟通的艺术III:看人之间 之倾听
- Today in history: the first e-book came out; The inventor of magnetic stripe card was born; The pioneer of handheld computer was born
- 2021年山东省赛题库题目抓包
猜你喜欢
Window下线程与线程同步总结
微信核酸检测预约小程序系统毕业设计毕设(8)毕业设计论文模板
ByteDance Interviewer: how to calculate the memory size occupied by a picture
Solution of ellipsis when pytorch outputs tensor (output tensor completely)
How to write high-quality code?
Idea create a new sprintboot project
谈谈对Flink框架中容错机制及状态的一致性的理解
In the year of "mutual entanglement" of mobile phone manufacturers, the "machine sea tactics" failed, and the "slow pace" playing method rose
非技术部门,如何参与 DevOps?
C语言实现QQ聊天室小项目 [完整源码]
随机推荐
GO项目实战 — Gorm格式化时间字段
Learning notes 5 - high precision map solution
Ad20 make logo
How to write high-quality code?
Go项目实战—参数绑定,类型转换
LSTM应用于MNIST数据集分类(与CNN做对比)
Should the dependency given by the official website be Flink SQL connector MySQL CDC, with dependency added
A large number of virtual anchors in station B were collectively forced to refund: revenue evaporated, but they still owe station B; Jobs was posthumously awarded the U.S. presidential medal of freedo
上拉加载原理
Today in history: the first e-book came out; The inventor of magnetic stripe card was born; The pioneer of handheld computer was born
Nine degrees 1480: maximum ascending subsequence sum (dynamic programming idea for the maximum value)
Qt实现json解析
Nuxt//
C语言实现QQ聊天室小项目 [完整源码]
"Everyday Mathematics" serial 58: February 27
How to plan the career of a programmer?
请问postgresql cdc 怎么设置单独的增量模式呀,debezium.snapshot.mo
websocket
[vite] 1371 - develop vite plug-ins by hand
Blockbuster: the domestic IDE is released, developed by Alibaba, and is completely open source!