What are the mainstream ORM frameworks in .NET (C#), SqlSugar, Dapper, EF or...

What are the mainstream ORM frameworks in .NET (C#), SqlSugar, Dapper, EF or...

Preface

In a previous article, I shared " What is ORM?" Why use ORM? Analysis of the use and pros and cons of ORM . So, in the current .NET (C#) world, what are the mainstream ORMs, SqlSugar, Dapper, Entity Framework (EF) or ServiceStack.OrmLite? Or do you have a better ORM recommendation? If so, share it with everyone if you don’t prevent it.

.NET (C#) mainstream ORM overview

Today’s article shares several collections of currently popular ORM frameworks in .NET (C#), such as (the following frameworks are all open source frameworks and are hosted on github):

SqlSugar

SqlSugar is a .NET-based ORM framework developed by Chinese developers. It is a high-performance and lightweight ORM framework that can run on .NET 4.+ & .NET CORE. It is the easiest to use database access among many .NET frameworks. technology.

Features:

  • Open source and free
  • Development and maintenance by domestic developers;
  • Support .NET Core;
  • Support mainstream databases, such as: SQL Server, MySql, Oracle, Sqlite, etc.;
  • Timely maintenance and updates

Recommended level: ★★★★☆

PetaPoco

PetaPoco: Lightweight POCO object and database mapping ORM framework.

Features:

  • Open source and free

Recommended level: ★★★★☆

linq2db

linq2db is also a fast, lightweight, and type-safe ORM framework for POCO object and database mapping. Architecturally speaking, linq2db is a further encapsulation of micro-ORMs such as Dapper and PetaPoco, but it is not as cumbersome as Entity Framework. It does not implement state tracking, and needs to deal with entity state changes by itself.

Recommended level: ★★★★☆

Dos.ORM

Dos.ORM (formerly Hxj.Data) was released in 2009 and officially open sourced in 2015. In the development process, NBear and MySoft were referred to, some of their essence was absorbed, new ideas were added, and a large number of extensions were made with reference to EF's Lambda syntax. This component has been applied in hundreds of mature projects. Official website: http://ITdos.com/Dos/ORM/Index.html

Features:

  • Open source and free
  • Easy to get started, zero learning cost. Easy to use, write C#.NET code in accordance with sql writing habits. Powerful
  • High performance, close to handwritten Sql
  • Small size (less than 150kb, only one dll)
  • Perfect support for Sql Server (2000 to the latest version), MySql, Oracle, Access, Sqlite and other databases
  • Support a large number of Lambda expressions, the domestic ORM support is the highest, and the open source Chinese ORM ranks top three
  • No need for XML configuration like NHibernate, no need for various database connection drivers like EF
  • Follow the MIT open source agreement, except that the name change is not allowed, other custom modifications are free

Recommended level: ★★★☆☆

ServiceStack.OrmLite

The goal of ServiceStack.OrmLite is to provide a convenient, non-interference, and configuration-free RDBMS-independent type encapsulation that maintains a high degree of compatibility with SQL, displays intuitive APIs, and can generate predictable SQL. The purpose of ServiceStack.OrmLite: Fast, Simple, Typed ORM for .NET

Features:

  • Open source, chargeable (the free version only supports 10 tables in a single library)

Recommended level: ★★★☆☆

Entity Framework (EF)

ADO.NET Entity Framework is an O/R Mapping solution developed by Microsoft based on ADO.NET. The framework used to be part of the .NET Framework, but it was separated from the .NET Framework after version 6.

Recommended level: ★★★☆☆

NHibernate

NHibernate is an object/relational database mapping tool for .NET environment. The term object/relational mapping (ORM) refers to a technique used to map objects represented by an object model to a SQL-based relational model data structure.

Features:

  • Open source and free
  • Batch write
  • Batch read/multiple query feature (I understand that I mean Future?)
  • Batch collection loading
  • Collection with lazy="extra"
  • Collection filter and pagination collection
  • Second-level cache (actually NH's second-level cache looks very simple?)
  • Integration and scalability
  • Automatic code generation, reducing the amount of code and sql development, freeing developers from opening sql, ado.net, transactions, caching and other underlying layers

Recommended level: ★★★☆☆

Massive

Massive: Small, dynamic micro-ORM framework.

Recommended level: ★★★☆☆

The above is the part of the ORM framework that is currently popular in .NET (C#) collected by the author.

If you have other better ORMs, please leave a message and communicate.

If you think this article is helpful to you or others, please like it.

This article published synchronized to Figure sharing network " The current .NET (C #) world, what mainstream ORM - SqlSugar, Dapper, Entity Framework (EF) or ... "

Reference: https://cloud.tencent.com/developer/article/1034519 .NET(C#) What are the mainstream ORM frameworks, SqlSugar, Dapper, EF or...-Cloud + Community-Tencent Cloud