mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-10-27 03:09:34 +08:00
Update SqlSugraScopProvider
This commit is contained in:
@@ -13,6 +13,7 @@ namespace SqlSugar
|
||||
public class SqlSugarScopeProvider:ISqlSugarClient
|
||||
{
|
||||
internal SqlSugarProvider conn;
|
||||
StackFrame[] frames;
|
||||
|
||||
public SqlSugarScopeProvider(SqlSugarProvider conn)
|
||||
{
|
||||
@@ -89,10 +90,13 @@ namespace SqlSugar
|
||||
private dynamic GetKey()
|
||||
{
|
||||
var key= "SqlSugarProviderScope_" + conn.CurrentConnectionConfig.ConfigId;
|
||||
var methods= new StackTrace(true).GetFrames();
|
||||
if (methods.Length >= 0)
|
||||
if (frames == null)
|
||||
{
|
||||
foreach (var method in methods.Take(10))
|
||||
frames = new StackTrace(true).GetFrames();
|
||||
}
|
||||
if (frames.Length >= 0)
|
||||
{
|
||||
foreach (var method in frames.Take(10))
|
||||
{
|
||||
var getInterfaces = method.GetMethod()?.ReflectedType?.GetInterfaces();
|
||||
if (getInterfaces != null && getInterfaces.Any(it => it.Name.IsIn("IJob", "IHostedService")))
|
||||
|
||||
Reference in New Issue
Block a user