SqlSugarUtility 1.0.16
dotnet add package SqlSugarUtility --version 1.0.16
NuGet\Install-Package SqlSugarUtility -Version 1.0.16
<PackageReference Include="SqlSugarUtility" Version="1.0.16" />
<PackageVersion Include="SqlSugarUtility" Version="1.0.16" />
<PackageReference Include="SqlSugarUtility" />
paket add SqlSugarUtility --version 1.0.16
#r "nuget: SqlSugarUtility, 1.0.16"
#:package SqlSugarUtility@1.0.16
#addin nuget:?package=SqlSugarUtility&version=1.0.16
#tool nuget:?package=SqlSugarUtility&version=1.0.16
SqlSugarUtility
using SqlSugar;
public static class SqlSugarHelper
{
private static ISqlSugarClient? _client = null;
public static ISqlSugarClient Db
{
get
{
if (_client == null)
{
var dbType = DbType.SqlServer;
//var connectionString = "Data Source=192.168.x.x;Initial Catalog=xxx;User ID=sa;PWD=xxx";
if (string.IsNullOrWhiteSpace(connectionString)) throw new Exception("连接字符串不能空");
_client = SqlSugarUtility.GetSingletonSqlSugarClient<IgnoreAttribute>(dbType, connectionString, false, db =>
{
//(A)全局生效配置点,一般AOP和程序启动的配置扔这里面 ,所有上下文生效
//调试SQL事件,可以删掉
db.Aop.OnLogExecuting = (sql, pars) =>
{
#if DEBUG
//Console.WriteLine(sql);//输出sql,查看执行sql 性能无影响
//5.0.8.2 获取无参数化 SQL 对性能有影响,特别大的SQL参数多的,调试使用
var sql2 = UtilMethods.GetSqlString(db.CurrentConnectionConfig.DbType, sql, pars);
Console.WriteLine(sql2);//输出sql,查看执行sql 性能无影响
System.Diagnostics.Debug.WriteLine(sql2);
#endif
};
db.Aop.OnError = (ex) =>
{
Console.WriteLine(ex.Message);//输出sql,查看执行sql 性能无影响
System.Diagnostics.Debug.Fail(ex.Message);
};
db.Aop.OnDiffLogEvent = (diff) =>
{
};
});
}
return _client;
}
}
}
public class IgnoreAttribute : Attribute { }
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| .NET Framework | net48 is compatible. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.8
- SqlSugar (>= 5.1.4.207)
- System.ComponentModel.Annotations (>= 5.0.0)
- Yitter.IdGenerator.Net45 (>= 1.0.0)
-
.NETStandard 2.1
- SqlSugarCore (>= 5.1.4.214)
- System.ComponentModel.Annotations (>= 5.0.0)
- Yitter.IdGenerator (>= 1.0.15)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on SqlSugarUtility:
| Package | Downloads |
|---|---|
|
SqlSugarUtility.Extensions
A powerful extension toolkit for SqlSugar ORM. Provides a flexible client factory with easy configuration (singleton/scope), integrates Yitter SnowFlake ID generator, and offers rich extension methods for SimpleClient and ISugarQueryable. Simplifies common data access patterns like paging, array conversion, and attribute-based entity mapping. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.16 | 109 | 5/12/2026 |
| 1.0.14 | 112 | 2/24/2026 |
| 1.0.13 | 232 | 8/15/2025 |
| 1.0.12 | 219 | 8/15/2025 |
| 1.0.11 | 255 | 5/8/2025 |
| 1.0.10 | 237 | 4/30/2025 |
| 1.0.9 | 303 | 4/14/2025 |
| 1.0.8 | 307 | 4/14/2025 |
| 1.0.7 | 259 | 6/4/2024 |
| 1.0.6 | 267 | 4/25/2024 |
| 1.0.5 | 327 | 5/19/2023 |
| 1.0.4 | 331 | 4/14/2023 |
| 1.0.1 | 323 | 4/11/2023 |
| 1.0.0.2 | 228 | 4/25/2024 |
## v1.0.0
- 🚀 **SqlSugar Client Factory**: Simplified creation of SqlSugarScope and SqlSugarClient with built-in attribute mapping (Description, DefaultValue, Key, etc.).
- ❄️ **SnowFlake ID Integration**: Customizable SnowFlake ID generator (Yitter) configured by default.
- 🔧 **Convenience Extensions**: Added paging, counting, and array conversion methods for `SimpleClient` and `ISugarQueryable` (e.g., `ToPageList`, `ForEachByPage`, `GetArray`).
- 🧩 **Attribute Support**: Automatic recognition of common .NET attributes for database schema definition.