2020.NET ORM complete comparison and help selection

 1|0 .NET ORM Preface

Why write this article?

I hope to optimize the search engine for SEO so that more Chinese people can know and use it. At present, Baidu search .NET ORM is all sqlsugar. I am speechless. The first thing everyone enters into the group is to compare them. They have to answer, answer and persuade them every day. It is very difficult to convince the tags to be the same type of .NET ORM with great reputation and many users. FreeSql does not want to be its own shining gold. I hope to write this complete .NET ORM comparison in 2020. For those who are ready to use FreeSql, it would be great to be ranked on the Baidu search engine.

I would like to invite friends who are using CSRedisCore and FreeSql to forward this article with their fingers, and add a link to the original text to point to this article, thank you! QQ group: 4336577 (full), 8585575 (online), 52508226 (online)

Original articles welcome to reprint, 2020 Chinese version. NET ORM complete function comparison

MarkDown:https://files.cnblogs.com/files/kellynic/ORM_VS.zip

Article link: https://www.cnblogs.com/kellynic/p/13664720.html

 2|0 .NET ORM basic information comparison

Function item FreeSql EFCore SqlSugar
Birth time December 2018 2015 (approximately) 2014 (approximately)
Open source agreement WITH Apache-2.0 Apache-2.0
Affiliation dotnetcore(NCC) dotnet sunkaixuan (individual)
Number of unit tests 5500+ a lot of no
github star 2.1k+ 9.5k+ 3.1k+
github issues active active Not active
Support platform .NET4.0+、.NETCore .NETCore .NET4.5+、.NETCore
Support database Many and consistent behavior a lot of SqlServer/MySql/Sqlite/Oracle
life cycle Singleton Scoped Scoped
How to use IFreeSql、Repository DbContext SugarClient

 FreeSql .NET ORM supports MySql/SqlServer/PostgreSQL/Oracle/Sqlite/Firebird/Dameng/Renda Jincang/Shenzhou General/Access.

.NET ORM has its own housekeeping skills. This article mainly lists and compares the functions provided by FreeSql. If you offend, please forgive me, and you are welcome to make functional suggestions to FreeSql.

The depth level of each function implementation is different (for example, EFCore supports SqlServer 2012, FreeSql supports SqlServer 2005), it is difficult to compare thoroughly. Tips:

  • The functions compared in this article FreeSql are basically provided for each database, unlike EFCore which favors SqlServer
  • This article only compares the official functions (not including third-party extensions)

 3|0. NET ORM overall function comparison

Function item FreeSql EFCore SqlSugar
.NET ORM CodeFirst creates a table structure based on the entity type
.NET ORM CodeFirst compares the table structure according to the entity type -
.NET ORM CodeFirst based on entity type annotations, migration table structure remarks - -
.NET ORM CodeFirst FluentApi -
.NET ORM CodeFirst FluentApi syntax is compatible with EFCore -
.NET ORM CodeFirst entity features compatible with EFCore -
.NET ORM CodeFirst custom entity characteristics (Aop) -
.NET ORM CodeFirst type conversion mapping (MapType) -
.NET ORM DbFirst generates entity classes based on the database
.NET ORM navigation properties (OneToOne) -
.NET ORM Navigation Properties (ManyToOne) -
.NET ORM Navigation Properties (OneToMany) -
.NET ORM navigation properties (ManyToMany) - -
.NET ORM navigation attribute (Parent)  parent-child entity class - -
.NET ORM navigation attributes delayed loading, greedy loading, cascading save -
.NET ORM custom expression tree analysis - -
.NET ORM global filter -
.NET ORM transaction
.NET ORM read-write separation -
.NET ORM sub-table sub-database - -
.NET ORM Repository - -
.NET ORM unit of work UnitOfWork - -
.NET ORM unit of work manager UnitOfWorkManager - -
.NET ORM DbContext state management -

4|0 .NET ORM CRUD feature comparison

Function item FreeSql EFCore SqlSugar
.NET ORM CRUD, mapping the dynamic table name -
.NET ORM CRUD, use parameterized SQL execution
.NET ORM CRUD, do not use parameterized SQL execution (NoneParameter) - -
For .NET ORM CRUD, get the corresponding SQL (ToSql) -
.NET ORM CRUD, unified audit entity attribute value (Aop.AuditValue) - -
       
.NET ORM insert (single)
.NET ORM when inserting, ignore/specify column -
.NET ORM inserts, returns the number of rows affected -
When .NET ORM is inserted, return the self-increment value after inserting
When the .NET ORM is inserted, return the inserted record - -
When .NET ORM is inserted, Insert Ignore Into - -
When .NET ORM is inserted, On Duplicate Key Update - -
When .NET ORM is inserted, On Conflict Do Update - -
.NET ORM batch insert  performance test results reference documents -
.NET ORM batch insert, automatically batch  reference documents - -
.NET ORM batch insert, use BulkCopy - -
       
.NET ORM update (single entry)
When the .NET ORM is updated, dynamic conditions (WhereDynamic) -
When the .NET ORM is updated, update according to the entity object -
.NET ORM 更新时,根据状态管理只更新有变化的属性 -
.NET ORM 更新时,忽略/指定列 -
.NET ORM 更新时,原子性 set num=num+1 -
.NET ORM 更新时,指定条件 -
.NET ORM 更新时,自动附加全局过滤器条件 - -
.NET ORM 更新时,不需要先查询 -
.NET ORM 更新时,使用乐观行锁 -
.NET ORM 更新时,使用悲观锁 - -
.NET ORM 更新时,返回影响的行数 -
.NET ORM 更新时,返回插入后的记录 - -
.NET ORM 批量更新 - -
       
.NET ORM 删除(单条)
.NET ORM 删除时,动态条件(WhereDynamic) -
.NET ORM 删除时,指定条件 -
.NET ORM 删除时,自动附加全局过滤器条件 - -
.NET ORM 删除时,不需要先查询 -
.NET ORM 删除时,返回影响的行数 -
.NET ORM 删除时,返回插入后的记录 - -
.NET ORM 级联保存 -
.NET ORM 添加或更新 -
.NET ORM 添加或更新,自动适配 merge into 参考文档 - -
.NET ORM 批量编辑保存 参考文档 -
       
.NET ORM 查询(单条)
.NET ORM 查询时,分页
.NET ORM 查询时,分页支持 SqlServer2008 -
.NET ORM 查询时,动态条件(WhereDynamic) -
.NET ORM 查询时,动态过滤条件(WhereDynamicFilter) 参考文档 -
.NET ORM 查询时,自动附加全局过滤器条件 - -
.NET ORM 查询时,多表条件传播(WhereCascade) - -
.NET ORM 查询时,在 lambda 中使用导航属性 -
.NET ORM 查询时,用 Dto 映射只需要查询的字段 - -
.NET ORM 查询时,传 Sql 作二次查询(WithSql) -
.NET ORM 查询时,子查询(Exists) -
.NET ORM 查询时,子查询(In) -
.NET ORM 查询时,子查询拼接结果(string.Join) 参考文档 - -
.NET ORM 查询时,使用分组聚合(GroupBy/Having)
.NET ORM 查询时,使用 Linq To Sql 语法 -
.NET ORM 查询时,针对树形结构表 父子关系的实体类 - -

5|0  .NET ORM 总结

.NET ORM FreeSql 功能强大,扩展方便,从 issues 和 qq群 可以看得出社区更新极积有问必应;

.NET ORM EFCore 主要是面向对象操作,许多方式不符合中国人习惯,长期更新(但不友好兼容);

.NET ORM SqlSugar 历史问题多,并且 issues 和 qq群 已经基本不解决问题;


.NET ORM FreeSql 作者的努力希望能打动到你,肯请正在使用的、善良的您能动一动小手指,把文章转发一下,让更多人知道 .NET 有这样一个好用的 ORM 存在。谢谢了!!

.NET ORM FreeSql 开源协议 MIT https://github.com/dotnetcore/FreeSql,可以商用,文档齐全。QQ群:4336577(已满)、8578575(在线)、52508226(在线)

如果你有好的 ORM 实现想法,欢迎给作者留言讨论,谢谢观看!

转载申明:

原文作者:FreeSql & CSRedis 
原文链接:https://www.cnblogs.com/kellynic/p/13664720.html
关于博主:评论和私信会在第一时间回复。或者直接私信我。
版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
声援博主:如果您觉得文章对您有帮助,可以点击文章右下角推荐一下。您的鼓励是博主的最大动力!

Guess you like

Origin blog.csdn.net/ChaITSimpleLove/article/details/108579611