2025-07-04 09:50:02 +08:00

34 lines
866 B
C#

using Microsoft.Practices.Unity;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Text;
using MyCode.Project.Domain.Config;
using MyCode.Project.Infrastructure.Cache;
namespace MyCode.Project.Repositories.Common
{
public class MyCodeSqlSugarClient : SqlSugar.SqlSugarClient
{
public MyCodeSqlSugarClient() : base(config)
{
}
private static ConnectionConfig config = new ConnectionConfig()
{
ConnectionString = SystemConfig.ConnectionMasterStr,
DbType = DbType.SqlServer,
InitKeyType = InitKeyType.Attribute,
IsAutoCloseConnection = true,
ConfigureExternalServices = new ConfigureExternalServices()
{
DataInfoCacheService = new HttpRuntimeCache()
}
};
}
}