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
6558991929
commit
0946f824c0
@ -6,13 +6,14 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
namespace SqlSugar
|
||||
{
|
||||
|
||||
|
||||
public class InstanceFactory
|
||||
{
|
||||
static Assembly assembly = Assembly.GetExecutingAssembly();
|
||||
static Dictionary<string, Type> typeCache = new Dictionary<string, Type>();
|
||||
private static string _CustomDllName = "";
|
||||
private static List<string> CustomDlls = new List<string>();
|
||||
public static Assembly[] CustomAssemblies = new Assembly[]{};
|
||||
public static string CustomDllName {
|
||||
get { return _CustomDllName; }
|
||||
set
|
||||
@ -637,6 +638,10 @@ namespace SqlSugar
|
||||
var newAssembly = new ReflectionInoCacheService().GetOrCreate<Assembly>(key, () => {
|
||||
try
|
||||
{
|
||||
if (CustomAssemblies?.Any(it => it.FullName.StartsWith(customDllName))==true)
|
||||
{
|
||||
return CustomAssemblies?.First(it => it.FullName.StartsWith(customDllName));
|
||||
}
|
||||
var path = Assembly.GetExecutingAssembly().Location;
|
||||
if (path.HasValue())
|
||||
{
|
||||
@ -692,6 +697,10 @@ namespace SqlSugar
|
||||
var newAssembly = new ReflectionInoCacheService().GetOrCreate<Assembly>(key, () => {
|
||||
try
|
||||
{
|
||||
if (CustomAssemblies?.Any(it => it.FullName.StartsWith(customDllName)) == true)
|
||||
{
|
||||
return CustomAssemblies?.First(it => it.FullName.StartsWith(customDllName));
|
||||
}
|
||||
var path = Assembly.GetExecutingAssembly().Location;
|
||||
if (path.HasValue())
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user