mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2026-02-27 16:50:33 +08:00
Optimize Job
This commit is contained in:
@@ -26,12 +26,16 @@ namespace SqlSugar
|
||||
if (methods.Length>=0)
|
||||
{
|
||||
foreach (var method in methods.Take(10))
|
||||
{
|
||||
var getInterfaces = method.GetMethod()?.ReflectedType?.ReflectedType?.GetInterfaces();
|
||||
if (getInterfaces!=null&& getInterfaces.Any(it=>it.Name.IsIn("IJob", "IHostedService")))
|
||||
{
|
||||
var refType = method.GetMethod()?.ReflectedType;
|
||||
if (refType != null)
|
||||
{
|
||||
key = $"{key}IJob";
|
||||
break;
|
||||
var getInterfaces = refType.Name.StartsWith("<") ? refType?.ReflectedType?.GetInterfaces() : refType?.GetInterfaces();
|
||||
if (getInterfaces != null && getInterfaces.Any(it => it.Name.IsIn("IJob")))
|
||||
{
|
||||
key = $"{key}IJob";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,11 +98,15 @@ namespace SqlSugar
|
||||
{
|
||||
foreach (var method in frames.Take(10))
|
||||
{
|
||||
var getInterfaces = method.GetMethod()?.ReflectedType?.ReflectedType?.GetInterfaces();
|
||||
if (getInterfaces != null && getInterfaces.Any(it => it.Name.IsIn("IJob", "IHostedService")))
|
||||
var refType = method.GetMethod()?.ReflectedType;
|
||||
if (refType != null)
|
||||
{
|
||||
key = $"{key}IJob";
|
||||
break;
|
||||
var getInterfaces = refType.Name.StartsWith("<") ? refType?.ReflectedType?.GetInterfaces() : refType?.GetInterfaces();
|
||||
if (getInterfaces != null && getInterfaces.Any(it => it.Name.IsIn("IJob")))
|
||||
{
|
||||
key = $"{key}IJob";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user