mccj - SqlSugarUtility 1.0.10

Package Description

PM> Install-Package SqlSugarUtility -Version 1.0.10 -Source https://www.myget.org/F/mccj/api/v3/index.json

Copy to clipboard

> nuget.exe install SqlSugarUtility -Version 1.0.10 -Source https://www.myget.org/F/mccj/api/v3/index.json

Copy to clipboard

> dotnet add package SqlSugarUtility --version 1.0.10 --source https://www.myget.org/F/mccj/api/v3/index.json

Copy to clipboard
<PackageReference Include="SqlSugarUtility" Version="1.0.10" />
Copy to clipboard
source https://www.myget.org/F/mccj/api/v3/index.json

nuget SqlSugarUtility  ~> 1.0.10
Copy to clipboard

> choco install SqlSugarUtility --version 1.0.10 --source https://www.myget.org/F/mccj/api/v2

Copy to clipboard
Import-Module PowerShellGet
Register-PSRepository -Name "mccj" -SourceLocation "https://www.myget.org/F/mccj/api/v2"
Install-Module -Name "SqlSugarUtility" -RequiredVersion "1.0.10" -Repository "mccj" 
Copy to clipboard

SqlSugarUtility

Build status MyGet NuGet MIT License

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 { }
  • .NETFramework 4.8
    • SqlSugar (>= 5.1.4.189)
    • System.ComponentModel.Annotations (>= 5.0.0)
    • Yitter.IdGenerator.Net45 (>= 1.0.0)
  • .NETStandard 2.1
    • SqlSugarCore (>= 5.1.4.189)
    • System.ComponentModel.Annotations (>= 5.0.0)
    • Yitter.IdGenerator (>= 1.0.15)
  • .NETFramework 4.8: 4.8.0.0
  • .NETStandard 2.1: 2.1.0.0

Owners

mccj

Authors

SqlSugarUtility

Project URL

https://github.com/mccj/SqlSugarUtility

License

Unknown

Info

31 total downloads
5 downloads for version 1.0.10
Download (17.88 KB)
Found on the current feed only

Package history

Version Size Last updated Downloads Mirrored?
1.0.13 17.82 KB Fri, 15 Aug 2025 06:07:06 GMT 2
1.0.12 17.87 KB Fri, 15 Aug 2025 02:53:22 GMT 3
1.0.11 17.89 KB Thu, 08 May 2025 02:26:14 GMT 5
1.0.10 17.88 KB Wed, 30 Apr 2025 05:51:59 GMT 5
1.0.8 16.98 KB Tue, 21 Jan 2025 05:50:10 GMT 8
1.0.7 16.35 KB Tue, 04 Jun 2024 08:32:00 GMT 8