mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-05 17:37:58 +08:00
Update Instancefactory
This commit is contained in:
parent
e5f8149c97
commit
b0d6a4bb0d
@ -670,17 +670,32 @@ namespace SqlSugar
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
internal static Type GetCustomTypeByClass<T>(string className)
|
||||
{
|
||||
var key = "Assembly_" + CustomDllName + assembly.GetHashCode();
|
||||
Type type = null;
|
||||
foreach (var item in CustomDlls.AsEnumerable())
|
||||
{
|
||||
if (type == null)
|
||||
{
|
||||
type = GetCustomTypeByClass<T>(className, item);
|
||||
}
|
||||
if (type != null)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
return type;
|
||||
}
|
||||
internal static Type GetCustomTypeByClass<T>(string className,string customDllName)
|
||||
{
|
||||
var key = "Assembly_" + customDllName + assembly.GetHashCode();
|
||||
var newAssembly = new ReflectionInoCacheService().GetOrCreate<Assembly>(key, () => {
|
||||
try
|
||||
{
|
||||
var path = Assembly.GetExecutingAssembly().Location;
|
||||
if (path.HasValue())
|
||||
{
|
||||
path = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(path), CustomDllName + ".dll");
|
||||
path = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(path), customDllName + ".dll");
|
||||
}
|
||||
if (path.HasValue() && FileHelper.IsExistFile(path))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user