mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-29 19:56:43 +08:00
RemoveCache BUG
This commit is contained in:
parent
8a74acfbef
commit
4610236738
@ -21,6 +21,7 @@ namespace SqlSugar
|
||||
public bool IsEnableDiffLogEvent { get; set; }
|
||||
public DiffLogModel diffModel { get; set; }
|
||||
public List<string> tempPrimaryKeys { get; set; }
|
||||
private Action RemoveCacheFunc { get; set; }
|
||||
public EntityInfo EntityInfo
|
||||
{
|
||||
get
|
||||
@ -213,8 +214,11 @@ namespace SqlSugar
|
||||
|
||||
public IDeleteable<T> RemoveDataCache()
|
||||
{
|
||||
var cacheService = this.Context.CurrentConnectionConfig.ConfigureExternalServices.DataInfoCacheService;
|
||||
CacheSchemeMain.RemoveCache(cacheService, this.Context.EntityMaintenance.GetTableName<T>());
|
||||
this.RemoveCacheFunc = () =>
|
||||
{
|
||||
var cacheService = this.Context.CurrentConnectionConfig.ConfigureExternalServices.DataInfoCacheService;
|
||||
CacheSchemeMain.RemoveCache(cacheService, this.Context.EntityMaintenance.GetTableName<T>());
|
||||
};
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -398,6 +402,9 @@ namespace SqlSugar
|
||||
if (this.Context.Ado.DiffLogEvent != null)
|
||||
this.Context.Ado.DiffLogEvent(diffModel);
|
||||
}
|
||||
if (this.RemoveCacheFunc != null) {
|
||||
this.RemoveCacheFunc();
|
||||
}
|
||||
}
|
||||
|
||||
private void Before(string sql)
|
||||
|
@ -29,6 +29,7 @@ namespace SqlSugar
|
||||
public bool IsAs { get; set; }
|
||||
public bool IsEnableDiffLogEvent { get; set; }
|
||||
public DiffLogModel diffModel { get; set; }
|
||||
private Action RemoveCacheFunc { get; set; }
|
||||
|
||||
|
||||
#region Core
|
||||
@ -214,8 +215,11 @@ namespace SqlSugar
|
||||
|
||||
public IInsertable<T> RemoveDataCache()
|
||||
{
|
||||
var cacheService = this.Context.CurrentConnectionConfig.ConfigureExternalServices.DataInfoCacheService;
|
||||
CacheSchemeMain.RemoveCache(cacheService, this.Context.EntityMaintenance.GetTableName<T>());
|
||||
this.RemoveCacheFunc = () =>
|
||||
{
|
||||
var cacheService = this.Context.CurrentConnectionConfig.ConfigureExternalServices.DataInfoCacheService;
|
||||
CacheSchemeMain.RemoveCache(cacheService, this.Context.EntityMaintenance.GetTableName<T>());
|
||||
};
|
||||
return this;
|
||||
}
|
||||
public IInsertable<T> EnableDiffLogEvent(object businessData = null)
|
||||
@ -436,6 +440,9 @@ namespace SqlSugar
|
||||
if (this.Context.Ado.DiffLogEvent != null)
|
||||
this.Context.Ado.DiffLogEvent(diffModel);
|
||||
}
|
||||
if (this.RemoveCacheFunc != null) {
|
||||
this.RemoveCacheFunc();
|
||||
}
|
||||
}
|
||||
private void Before(string sql)
|
||||
{
|
||||
|
@ -31,6 +31,7 @@ namespace SqlSugar
|
||||
public bool IsAs { get; set; }
|
||||
public bool IsEnableDiffLogEvent { get; set; }
|
||||
public DiffLogModel diffModel { get; set; }
|
||||
private Action RemoveCacheFunc { get; set; }
|
||||
|
||||
public virtual int ExecuteCommand()
|
||||
{
|
||||
@ -318,8 +319,11 @@ namespace SqlSugar
|
||||
|
||||
public IUpdateable<T> RemoveDataCache()
|
||||
{
|
||||
var cacheService = this.Context.CurrentConnectionConfig.ConfigureExternalServices.DataInfoCacheService;
|
||||
CacheSchemeMain.RemoveCache(cacheService, this.Context.EntityMaintenance.GetTableName<T>());
|
||||
this.RemoveCacheFunc = () =>
|
||||
{
|
||||
var cacheService = this.Context.CurrentConnectionConfig.ConfigureExternalServices.DataInfoCacheService;
|
||||
CacheSchemeMain.RemoveCache(cacheService, this.Context.EntityMaintenance.GetTableName<T>());
|
||||
};
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -597,6 +601,9 @@ namespace SqlSugar
|
||||
if (this.Context.Ado.DiffLogEvent != null)
|
||||
this.Context.Ado.DiffLogEvent(diffModel);
|
||||
}
|
||||
if (this.RemoveCacheFunc != null) {
|
||||
this.RemoveCacheFunc();
|
||||
}
|
||||
}
|
||||
|
||||
private void Before(string sql)
|
||||
|
Loading…
Reference in New Issue
Block a user