当前位置:网站首页>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
边栏推荐
猜你喜欢
手机厂商“互卷”之年:“机海战术”失灵,“慢节奏”打法崛起
【Vite】1371- 手把手开发 Vite 插件
重磅:国产IDE发布,由阿里研发,完全开源!
AD20 制作 Logo
pytorch输出tensor张量时有省略号的解决方案(将tensor完整输出)
Go-3-第一个Go程序
Today in history: the first e-book came out; The inventor of magnetic stripe card was born; The pioneer of handheld computer was born
AtCoder Beginner Contest 258「ABCDEFG」
AtCoder Beginner Contest 254「E bfs」「F st表维护差分数组gcd」
AtCoder Beginner Contest 258「ABCDEFG」
随机推荐
@Serializedname annotation use
中职组网络安全2021年江苏省省赛题目5套题目环境+解析全有需要的私信我
C语言实现QQ聊天室小项目 [完整源码]
2022年危险化学品生产单位安全生产管理人员特种作业证考试题库模拟考试平台操作
Idea create a new sprintboot project
Learning note 4 -- Key Technologies of high-precision map (Part 2)
【SWT组件】内容滚动组件 ScrolledComposite
How do programmers live as they like?
Today in history: the first e-book came out; The inventor of magnetic stripe card was born; The pioneer of handheld computer was born
【黑马早报】罗永浩回应调侃东方甄选;董卿丈夫密春雷被执行超7亿;吉利正式收购魅族;华为发布问界M7;豆瓣为周杰伦专辑提前开分道歉...
WorkManager学习一
手机厂商“互卷”之年:“机海战术”失灵,“慢节奏”打法崛起
Go项目实战—参数绑定,类型转换
5g NR system architecture
C function returns multiple value methods
非技术部门,如何参与 DevOps?
Web Components
变量///
5G NR系统架构
重磅:国产IDE发布,由阿里研发,完全开源!