mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-18 17:48:11 +08:00
Compatible with.NET 9.2 preview
This commit is contained in:
@@ -282,6 +282,10 @@ namespace SqlSugar
|
||||
{
|
||||
expItem = (item as UnaryExpression).Operand;
|
||||
}
|
||||
else if (item is MethodCallExpression callExpression&& callExpression.Method.Name== "op_Implicit")
|
||||
{
|
||||
expItem = callExpression.Arguments[0];
|
||||
}
|
||||
AppendItem(parameter, name, args, model, expItem);
|
||||
}
|
||||
if (appendArgs != null)
|
||||
|
@@ -1037,8 +1037,32 @@ namespace SqlSugar
|
||||
|
||||
private bool IsContainsArray(MethodCallExpression express, string methodName, bool isValidNativeMethod)
|
||||
{
|
||||
if (isMemoryExtensionsContainsArray(express, methodName))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return !isValidNativeMethod && express.Method.DeclaringType.Namespace.IsIn("System.Collections", "System.Linq", "System.Collections.Generic") && methodName == "Contains";
|
||||
}
|
||||
private bool isMemoryExtensionsContainsArray(MethodCallExpression express, string methodName)
|
||||
{
|
||||
var isMemoryExtensionsContainsArray = false;
|
||||
if (express.Method.DeclaringType.Name == "MemoryExtensions" && methodName == "Contains")
|
||||
{
|
||||
if (express.Arguments.Count() == 2)
|
||||
{
|
||||
if (express.Arguments.First() is MethodCallExpression callExpression)
|
||||
{
|
||||
if (callExpression.Method.Name == "op_Implicit")
|
||||
{
|
||||
isMemoryExtensionsContainsArray = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return isMemoryExtensionsContainsArray;
|
||||
}
|
||||
|
||||
private bool IsSubMethod(MethodCallExpression express, string methodName)
|
||||
{
|
||||
return SubTools.SubItemsConst.Any(it => it.Name == methodName) && express.Object != null && (express.Object.Type.Name.StartsWith("Subqueryable`"));
|
||||
|
Reference in New Issue
Block a user