mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-19 18:22:23 +08:00
-
This commit is contained in:
@@ -23,5 +23,14 @@ namespace SqlSugar
|
||||
/// Default SystemTable,If you do not have system table permissions, use attribute
|
||||
/// </summary>
|
||||
public InitKeyType InitKeyType = InitKeyType.SystemTable;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public ConfigureServices ConfigureExternalServices { get; set; }
|
||||
}
|
||||
|
||||
public class ConfigureServices
|
||||
{
|
||||
public ISerializeManager SerializeManager { get; set; }
|
||||
}
|
||||
}
|
||||
|
@@ -8,7 +8,7 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
namespace SqlSugar
|
||||
{
|
||||
public class ContextMethods : IRewritableMethods
|
||||
public class ContextMethods : IContextMethods
|
||||
{
|
||||
#region DataReader
|
||||
|
||||
@@ -263,7 +263,7 @@ namespace SqlSugar
|
||||
#endregion
|
||||
|
||||
#region Cache
|
||||
public ICacheManager<T> GetCacheInstance<T>()
|
||||
public ICacheService<T> GetCacheInstance<T>()
|
||||
{
|
||||
return ReflectionInoCache<T>.GetInstance();
|
||||
}
|
||||
|
@@ -356,13 +356,13 @@ namespace SqlSugar
|
||||
#endregion
|
||||
|
||||
#region Services
|
||||
public static ICacheManager<V> GetCacheInstance<V>()
|
||||
public static ICacheService<V> GetCacheInstance<V>()
|
||||
{
|
||||
return ReflectionInoCache<V>.GetInstance();
|
||||
}
|
||||
public static ISerializeManager GetSerializeInstance()
|
||||
{
|
||||
return SerializeManager.GetInstance();
|
||||
return SerializeService.GetInstance();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
@@ -25,7 +25,7 @@ namespace SqlSugar
|
||||
protected EntityMaintenance _EntityProvider;
|
||||
protected IAdo _Ado;
|
||||
protected ILambdaExpressions _LambdaExpressions;
|
||||
protected IRewritableMethods _RewritableMethods;
|
||||
protected IContextMethods _RewritableMethods;
|
||||
protected IDbMaintenance _DbMaintenance;
|
||||
protected QueryFilterProvider _QueryFilterProvider;
|
||||
protected SimpleClient _SimpleClient;
|
||||
|
@@ -3,7 +3,7 @@ using System.Collections.Generic;
|
||||
|
||||
namespace SqlSugar
|
||||
{
|
||||
public interface ICacheManager<V>
|
||||
public interface ICacheService<V>
|
||||
{
|
||||
V this[string key] { get; }
|
||||
void Add(string key, V value);
|
||||
@@ -12,6 +12,6 @@ namespace SqlSugar
|
||||
V Get(string key);
|
||||
IEnumerable<string> GetAllKey();
|
||||
void Remove(string key);
|
||||
V GetOrCreate(string cacheKey, Func<ICacheManager<V>, string, V> successAction, Func<ICacheManager<V>, string, V> errorAction);
|
||||
V GetOrCreate(string cacheKey, Func<ICacheService<V>, string, V> successAction, Func<ICacheService<V>, string, V> errorAction);
|
||||
}
|
||||
}
|
@@ -8,7 +8,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace SqlSugar
|
||||
{
|
||||
public interface IRewritableMethods
|
||||
public interface IContextMethods
|
||||
{
|
||||
ExpandoObject DataReaderToExpandoObject(IDataReader reader);
|
||||
List<ExpandoObject> DataReaderToExpandoObjectList(IDataReader reader);
|
||||
@@ -18,7 +18,7 @@ namespace SqlSugar
|
||||
T TranslateCopy<T>(T sourceObject);
|
||||
SqlSugarClient CopyContext(SqlSugarClient context, bool isCopyEvents = false);
|
||||
dynamic DataTableToDynamic(DataTable table);
|
||||
ICacheManager<T> GetCacheInstance<T>();
|
||||
ICacheService<T> GetCacheInstance<T>();
|
||||
void RemoveCacheAll();
|
||||
void RemoveCacheAll<T>();
|
||||
void RemoveCache<T>(string key);
|
@@ -5,7 +5,7 @@ using System.Text;
|
||||
|
||||
namespace SqlSugar
|
||||
{
|
||||
public interface ISerializeManager
|
||||
public interface ISerializeService
|
||||
{
|
||||
string SerializeObject(object value);
|
||||
T DeserializeObject<T>(string value);
|
@@ -6,7 +6,7 @@ using System.Collections;
|
||||
using System.Linq.Expressions;
|
||||
namespace SqlSugar
|
||||
{
|
||||
public class ReflectionInoCache<V> : ICacheManager<V>
|
||||
public class ReflectionInoCache<V> : ICacheService<V>
|
||||
{
|
||||
readonly System.Collections.Concurrent.ConcurrentDictionary<string, V> InstanceCache = new System.Collections.Concurrent.ConcurrentDictionary<string, V>();
|
||||
private static ReflectionInoCache<V> _instance = null;
|
||||
@@ -76,7 +76,7 @@ namespace SqlSugar
|
||||
return this.InstanceCache.Keys;
|
||||
}
|
||||
|
||||
public V GetOrCreate(string cacheKey, Func<ICacheManager<V>, string, V> successAction, Func<ICacheManager<V>, string, V> errorAction)
|
||||
public V GetOrCreate(string cacheKey, Func<ICacheService<V>, string, V> successAction, Func<ICacheService<V>, string, V> errorAction)
|
||||
{
|
||||
var cm = ReflectionInoCache<V>.GetInstance();
|
||||
if (cm.ContainsKey(cacheKey)) return successAction(cm, cacheKey);
|
@@ -6,16 +6,16 @@ using System.Text;
|
||||
|
||||
namespace SqlSugar
|
||||
{
|
||||
public class SerializeManager:ISerializeManager
|
||||
public class SerializeService:ISerializeService
|
||||
{
|
||||
private static SerializeManager _instance = null;
|
||||
private static SerializeService _instance = null;
|
||||
private static readonly object _instanceLock = new object();
|
||||
public static SerializeManager GetInstance() {
|
||||
public static SerializeService GetInstance() {
|
||||
if (_instance == null)
|
||||
lock (_instanceLock)
|
||||
if (_instance == null)
|
||||
{
|
||||
_instance = new SerializeManager();
|
||||
_instance = new SerializeService();
|
||||
}
|
||||
return _instance;
|
||||
}
|
@@ -93,11 +93,11 @@
|
||||
<Compile Include="ExpressionsToSql\Subquery\SubResolve.cs" />
|
||||
<Compile Include="ExpressionsToSql\Subquery\SubTools.cs" />
|
||||
<Compile Include="Infrastructure\DependencyManagement.cs" />
|
||||
<Compile Include="Interface\ISerializeManager.cs" />
|
||||
<Compile Include="Interface\ISerializeService.cs" />
|
||||
<Compile Include="Realization\Oracle\Deleteable\OracleDeleteable.cs" />
|
||||
<Compile Include="Realization\Oracle\Insertable\OracleInsertable.cs" />
|
||||
<Compile Include="Realization\Oracle\Updateable\OracleUpdateable.cs" />
|
||||
<Compile Include="Utilities\SerializeManager.cs" />
|
||||
<Compile Include="Services\SerializeService.cs" />
|
||||
<Compile Include="Utilities\ReflectionExtensions.cs" />
|
||||
<Compile Include="Realization\MySql\CodeFirst\MySqlCodeFirst.cs" />
|
||||
<Compile Include="Realization\MySql\DbFirst\MySqlDbFirst.cs" />
|
||||
@@ -134,7 +134,7 @@
|
||||
<Compile Include="Enum\DbObjectType.cs" />
|
||||
<Compile Include="Enum\ProperyType.cs" />
|
||||
<Compile Include="Utilities\FileHelper.cs" />
|
||||
<Compile Include="Interface\ICacheManager.cs" />
|
||||
<Compile Include="Interface\ICacheService.cs" />
|
||||
<Compile Include="Entities\DbResult.cs" />
|
||||
<Compile Include="Enum\InitKeyType.cs" />
|
||||
<Compile Include="Interface\IFilter.cs" />
|
||||
@@ -160,7 +160,7 @@
|
||||
<Compile Include="Abstract\SqlBuilderProvider\UpdateBuilder.cs" />
|
||||
<Compile Include="Abstract\SqlBuilderProvider\SqlBuilderAccessory.cs" />
|
||||
<Compile Include="Abstract\SqlBuilderProvider\SqlBuilderProvider.cs" />
|
||||
<Compile Include="Utilities\CacheManager.cs" />
|
||||
<Compile Include="Services\CacheService.cs" />
|
||||
<Compile Include="Utilities\Check.cs" />
|
||||
<Compile Include="Utilities\DbExtensions.cs" />
|
||||
<Compile Include="Utilities\ErrorMessage.cs" />
|
||||
@@ -239,7 +239,7 @@
|
||||
<Compile Include="Interface\IQueryable.cs" />
|
||||
<Compile Include="Interface\IDMLBuilder.cs" />
|
||||
<Compile Include="Interface\ISqlBuilder.cs" />
|
||||
<Compile Include="Interface\IRewritableMethods.cs" />
|
||||
<Compile Include="Interface\IContextMethods.cs" />
|
||||
<Compile Include="Interface\IUpdateable.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Infrastructure\SqlSugarAccessory.cs" />
|
||||
|
@@ -68,12 +68,12 @@ namespace SqlSugar
|
||||
|
||||
#region Util Methods
|
||||
[Obsolete("Use SqlSugarClient.Utilities")]
|
||||
public virtual IRewritableMethods RewritableMethods
|
||||
public virtual IContextMethods RewritableMethods
|
||||
{
|
||||
get { return this.Utilities; }
|
||||
set { this.Utilities = value; }
|
||||
}
|
||||
public virtual IRewritableMethods Utilities
|
||||
public virtual IContextMethods Utilities
|
||||
{
|
||||
get
|
||||
{
|
||||
|
Reference in New Issue
Block a user