Replace raw SQL queries in a .NET web app with C# code using SqlSugar to make the data layer easier to read and maintain.
Set up a multi-tenant application where each customer uses a separate database or table, using SqlSugar's built-in multi-tenant support.
Perform bulk inserts or updates of millions of rows efficiently using SqlSugar's large dataset handling features.
Build a paginated query API for a .NET web service using SqlSugar's built-in pagination and join query support.
SqlSugar is an open-source ORM framework for .NET applications. ORM stands for Object-Relational Mapper, which is a tool that lets developers read and write data to a database by writing regular code instead of raw database query language. Rather than typing out SQL statements by hand, you write C# code and SqlSugar translates it into the appropriate database queries automatically. The framework supports a wide range of databases, including MySQL, SQL Server, SQLite, Oracle, PostgreSQL, MongoDB, and several databases commonly used in China such as DaMeng, OceanBase, and GaussDB. It also covers custom databases via ODBC. This breadth makes it possible to swap between database engines without rewriting your application's data access code. SqlSugar is compatible with multiple .NET versions, from the older .NET Framework to the current .NET 9 and 10 releases. It is positioned as a low-code, easy-to-use alternative to more complex ORM tools, and it ships with features for common patterns like join queries, paginated results, multi-tenant database setups where different customers use separate databases or tables, and cross-database queries. The framework includes support for handling large datasets, with documented approaches for bulk inserts and updates of millions of rows, as well as subtable sharding for very large tables. It also supports patterns common in structured applications, such as Unit of Work, Repository, and dependency injection context objects. Documentation is available in both English and Chinese, with wiki pages covering each operation category including querying, inserting, updating, and deleting records. The project is maintained by the Fructose Big Data Technology team.
← dotnetnext on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.