mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-07-15 23:13:42 +08:00
Synchronization code
This commit is contained in:
parent
b0d6a4bb0d
commit
b85b5f300d
@ -344,6 +344,10 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
ids = ids.Select(it => Convert.ToInt64(it)).Cast<object>().ToList();
|
ids = ids.Select(it => Convert.ToInt64(it)).Cast<object>().ToList();
|
||||||
}
|
}
|
||||||
|
if (navPkColumn?.UnderType?.Name == UtilConstants.StringType.Name)
|
||||||
|
{
|
||||||
|
ids = ids.Select(it => it?.ToString()?.Replace(",", "[comma]")).Cast<object>().ToList();
|
||||||
|
}
|
||||||
conditionalModels.Add((new ConditionalModel()
|
conditionalModels.Add((new ConditionalModel()
|
||||||
{
|
{
|
||||||
ConditionalType = ConditionalType.In,
|
ConditionalType = ConditionalType.In,
|
||||||
@ -415,6 +419,10 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
ids = ids.Select(it => Convert.ToInt64(it)).Cast<object>().ToList();
|
ids = ids.Select(it => Convert.ToInt64(it)).Cast<object>().ToList();
|
||||||
}
|
}
|
||||||
|
if (navColumn?.UnderType?.Name == UtilConstants.StringType.Name)
|
||||||
|
{
|
||||||
|
ids = ids.Select(it => it?.ToString()?.Replace(",", "[comma]")).Cast<object>().ToList();
|
||||||
|
}
|
||||||
conditionalModels.Add((new ConditionalModel()
|
conditionalModels.Add((new ConditionalModel()
|
||||||
{
|
{
|
||||||
ConditionalType = ConditionalType.In,
|
ConditionalType = ConditionalType.In,
|
||||||
|
@ -265,6 +265,10 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
inValue1 = inValue1.Replace("'null'", "null");
|
inValue1 = inValue1.Replace("'null'", "null");
|
||||||
}
|
}
|
||||||
|
else if (inValue1.Contains("[comma]"))
|
||||||
|
{
|
||||||
|
inValue1 = inValue1.Replace("[comma]", ",");
|
||||||
|
}
|
||||||
else if (inValue1.Contains("[null]"))
|
else if (inValue1.Contains("[null]"))
|
||||||
{
|
{
|
||||||
inValue1 = inValue1.Replace("[null]", "null");
|
inValue1 = inValue1.Replace("[null]", "null");
|
||||||
|
@ -11,7 +11,19 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
static Assembly assembly = Assembly.GetExecutingAssembly();
|
static Assembly assembly = Assembly.GetExecutingAssembly();
|
||||||
static Dictionary<string, Type> typeCache = new Dictionary<string, Type>();
|
static Dictionary<string, Type> typeCache = new Dictionary<string, Type>();
|
||||||
public static string CustomDllName = "";
|
private static string _CustomDllName = "";
|
||||||
|
private static List<string> CustomDlls = new List<string>();
|
||||||
|
public static string CustomDllName {
|
||||||
|
get { return _CustomDllName; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (!CustomDlls.Contains(value))
|
||||||
|
{
|
||||||
|
CustomDlls.Add(value);
|
||||||
|
}
|
||||||
|
_CustomDllName = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
public static string CustomDbName = "";
|
public static string CustomDbName = "";
|
||||||
public static string CustomNamespace = "";
|
public static string CustomNamespace = "";
|
||||||
public static bool NoCache = false;
|
public static bool NoCache = false;
|
||||||
@ -605,14 +617,30 @@ namespace SqlSugar
|
|||||||
|
|
||||||
internal static Type GetCustomTypeByClass(string className)
|
internal static Type GetCustomTypeByClass(string className)
|
||||||
{
|
{
|
||||||
var key = "Assembly_"+ CustomDllName+assembly.GetHashCode();
|
Type type = null;
|
||||||
|
foreach (var item in CustomDlls.AsEnumerable())
|
||||||
|
{
|
||||||
|
if (type == null)
|
||||||
|
{
|
||||||
|
type = GetCustomTypeByClass(className, item);
|
||||||
|
}
|
||||||
|
if(type != null)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
internal static Type GetCustomTypeByClass(string className,string customDllName)
|
||||||
|
{
|
||||||
|
var key = "Assembly_" + customDllName + assembly.GetHashCode();
|
||||||
var newAssembly = new ReflectionInoCacheService().GetOrCreate<Assembly>(key, () => {
|
var newAssembly = new ReflectionInoCacheService().GetOrCreate<Assembly>(key, () => {
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var path = Assembly.GetExecutingAssembly().Location;
|
var path = Assembly.GetExecutingAssembly().Location;
|
||||||
if (path.HasValue())
|
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))
|
if (path.HasValue() && FileHelper.IsExistFile(path))
|
||||||
{
|
{
|
||||||
@ -642,17 +670,32 @@ namespace SqlSugar
|
|||||||
}
|
}
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static Type GetCustomTypeByClass<T>(string className)
|
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, () => {
|
var newAssembly = new ReflectionInoCacheService().GetOrCreate<Assembly>(key, () => {
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var path = Assembly.GetExecutingAssembly().Location;
|
var path = Assembly.GetExecutingAssembly().Location;
|
||||||
if (path.HasValue())
|
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))
|
if (path.HasValue() && FileHelper.IsExistFile(path))
|
||||||
{
|
{
|
||||||
|
@ -97,7 +97,7 @@ namespace SqlSugar
|
|||||||
args.Add(new MethodCallExpressionArgs
|
args.Add(new MethodCallExpressionArgs
|
||||||
{
|
{
|
||||||
MemberName = value,
|
MemberName = value,
|
||||||
MemberValue = value,
|
MemberValue = resPars.FirstOrDefault(it => it.ParameterName == value)?.Value?? value,
|
||||||
IsMember = true
|
IsMember = true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user