- 修复 System.MemoryExtensions.Contains 解析问题;#1993

This commit is contained in:
28810
2025-07-16 09:51:41 +08:00
parent 430ba602b6
commit 8fc418150d
28 changed files with 307 additions and 153 deletions

View File

@@ -111,7 +111,10 @@ namespace FreeSql.ClickHouse
if (objType?.FullName == "System.Byte[]") return null;
var argIndex = 0;
if (objType == null && callExp.Method.DeclaringType == typeof(Enumerable))
if (objType == null && (
callExp.Method.DeclaringType == typeof(Enumerable) ||
callExp.Method.DeclaringType.FullName == "System.MemoryExtensions"
))
{
objExp = callExp.Arguments.FirstOrDefault();
objType = objExp?.Type;

View File

@@ -112,7 +112,10 @@ namespace FreeSql.Custom
if (objType?.FullName == "System.Byte[]") return null;
var argIndex = 0;
if (objType == null && callExp.Method.DeclaringType == typeof(Enumerable))
if (objType == null && (
callExp.Method.DeclaringType == typeof(Enumerable) ||
callExp.Method.DeclaringType.FullName == "System.MemoryExtensions"
))
{
objExp = callExp.Arguments.FirstOrDefault();
objType = objExp?.Type;

View File

@@ -108,7 +108,10 @@ namespace FreeSql.Custom.MySql
if (objType?.FullName == "System.Byte[]") return null;
var argIndex = 0;
if (objType == null && callExp.Method.DeclaringType == typeof(Enumerable))
if (objType == null && (
callExp.Method.DeclaringType == typeof(Enumerable) ||
callExp.Method.DeclaringType.FullName == "System.MemoryExtensions"
))
{
objExp = callExp.Arguments.FirstOrDefault();
objType = objExp?.Type;

View File

@@ -112,7 +112,10 @@ namespace FreeSql.Custom.Oracle
if (objType?.FullName == "System.Byte[]") return null;
var argIndex = 0;
if (objType == null && callExp.Method.DeclaringType == typeof(Enumerable))
if (objType == null && (
callExp.Method.DeclaringType == typeof(Enumerable) ||
callExp.Method.DeclaringType.FullName == "System.MemoryExtensions"
))
{
objExp = callExp.Arguments.FirstOrDefault();
objType = objExp?.Type;

View File

@@ -111,7 +111,10 @@ namespace FreeSql.Custom.PostgreSQL
if (objType?.FullName == "System.Byte[]") return null;
var argIndex = 0;
if (objType == null && callExp.Method.DeclaringType == typeof(Enumerable))
if (objType == null && (
callExp.Method.DeclaringType == typeof(Enumerable) ||
callExp.Method.DeclaringType.FullName == "System.MemoryExtensions"
))
{
objExp = callExp.Arguments.FirstOrDefault();
objType = objExp?.Type;

View File

@@ -118,7 +118,10 @@ namespace FreeSql.Custom.SqlServer
if (objType?.FullName == "System.Byte[]") return null;
var argIndex = 0;
if (objType == null && callExp.Method.DeclaringType == typeof(Enumerable))
if (objType == null && (
callExp.Method.DeclaringType == typeof(Enumerable) ||
callExp.Method.DeclaringType.FullName == "System.MemoryExtensions"
))
{
objExp = callExp.Arguments.FirstOrDefault();
objType = objExp?.Type;

View File

@@ -112,7 +112,10 @@ namespace FreeSql.Dameng
if (objType?.FullName == "System.Byte[]") return null;
var argIndex = 0;
if (objType == null && callExp.Method.DeclaringType == typeof(Enumerable))
if (objType == null && (
callExp.Method.DeclaringType == typeof(Enumerable) ||
callExp.Method.DeclaringType.FullName == "System.MemoryExtensions"
))
{
objExp = callExp.Arguments.FirstOrDefault();
objType = objExp?.Type;

View File

@@ -111,7 +111,10 @@ namespace FreeSql.Duckdb
if (objType?.FullName == "System.Byte[]") return null;
var argIndex = 0;
if (objType == null && callExp.Method.DeclaringType == typeof(Enumerable))
if (objType == null && (
callExp.Method.DeclaringType == typeof(Enumerable) ||
callExp.Method.DeclaringType.FullName == "System.MemoryExtensions"
))
{
objExp = callExp.Arguments.FirstOrDefault();
objType = objExp?.Type;

View File

@@ -109,7 +109,10 @@ namespace FreeSql.Firebird
if (objType?.FullName == "System.Byte[]") return null;
var argIndex = 0;
if (objType == null && callExp.Method.DeclaringType == typeof(Enumerable))
if (objType == null && (
callExp.Method.DeclaringType == typeof(Enumerable) ||
callExp.Method.DeclaringType.FullName == "System.MemoryExtensions"
))
{
objExp = callExp.Arguments.FirstOrDefault();
objType = objExp?.Type;

View File

@@ -109,7 +109,10 @@ namespace FreeSql.GBase
if (objType?.FullName == "System.Byte[]") return null;
var argIndex = 0;
if (objType == null && callExp.Method.DeclaringType == typeof(Enumerable))
if (objType == null && (
callExp.Method.DeclaringType == typeof(Enumerable) ||
callExp.Method.DeclaringType.FullName == "System.MemoryExtensions"
))
{
objExp = callExp.Arguments.FirstOrDefault();
objType = objExp?.Type;

View File

@@ -112,7 +112,10 @@ namespace FreeSql.KingbaseES
if (objType?.FullName == "System.Byte[]") return null;
var argIndex = 0;
if (objType == null && callExp.Method.DeclaringType == typeof(Enumerable))
if (objType == null && (
callExp.Method.DeclaringType == typeof(Enumerable) ||
callExp.Method.DeclaringType.FullName == "System.MemoryExtensions"
))
{
objExp = callExp.Arguments.FirstOrDefault();
objType = objExp?.Type;

View File

@@ -82,7 +82,10 @@ namespace FreeSql.MsAccess
if (objType?.FullName == "System.Byte[]") return null;
var argIndex = 0;
if (objType == null && callExp.Method.DeclaringType == typeof(Enumerable))
if (objType == null && (
callExp.Method.DeclaringType == typeof(Enumerable) ||
callExp.Method.DeclaringType.FullName == "System.MemoryExtensions"
))
{
objExp = callExp.Arguments.FirstOrDefault();
objType = objExp?.Type;

View File

@@ -110,7 +110,10 @@ namespace FreeSql.MySql
if (objType?.FullName == "System.Byte[]") return null;
var argIndex = 0;
if (objType == null && callExp.Method.DeclaringType == typeof(Enumerable))
if (objType == null && (
callExp.Method.DeclaringType == typeof(Enumerable) ||
callExp.Method.DeclaringType.FullName == "System.MemoryExtensions"
))
{
objExp = callExp.Arguments.FirstOrDefault();
objType = objExp?.Type;

View File

@@ -112,7 +112,10 @@ namespace FreeSql.Odbc.Default
if (objType?.FullName == "System.Byte[]") return null;
var argIndex = 0;
if (objType == null && callExp.Method.DeclaringType == typeof(Enumerable))
if (objType == null && (
callExp.Method.DeclaringType == typeof(Enumerable) ||
callExp.Method.DeclaringType.FullName == "System.MemoryExtensions"
))
{
objExp = callExp.Arguments.FirstOrDefault();
objType = objExp?.Type;

View File

@@ -108,7 +108,10 @@ namespace FreeSql.Odbc.MySql
if (objType?.FullName == "System.Byte[]") return null;
var argIndex = 0;
if (objType == null && callExp.Method.DeclaringType == typeof(Enumerable))
if (objType == null && (
callExp.Method.DeclaringType == typeof(Enumerable) ||
callExp.Method.DeclaringType.FullName == "System.MemoryExtensions"
))
{
objExp = callExp.Arguments.FirstOrDefault();
objType = objExp?.Type;

View File

@@ -112,7 +112,10 @@ namespace FreeSql.Odbc.Oracle
if (objType?.FullName == "System.Byte[]") return null;
var argIndex = 0;
if (objType == null && callExp.Method.DeclaringType == typeof(Enumerable))
if (objType == null && (
callExp.Method.DeclaringType == typeof(Enumerable) ||
callExp.Method.DeclaringType.FullName == "System.MemoryExtensions"
))
{
objExp = callExp.Arguments.FirstOrDefault();
objType = objExp?.Type;

View File

@@ -111,7 +111,10 @@ namespace FreeSql.Odbc.PostgreSQL
if (objType?.FullName == "System.Byte[]") return null;
var argIndex = 0;
if (objType == null && callExp.Method.DeclaringType == typeof(Enumerable))
if (objType == null && (
callExp.Method.DeclaringType == typeof(Enumerable) ||
callExp.Method.DeclaringType.FullName == "System.MemoryExtensions"
))
{
objExp = callExp.Arguments.FirstOrDefault();
objType = objExp?.Type;

View File

@@ -118,7 +118,10 @@ namespace FreeSql.Odbc.SqlServer
if (objType?.FullName == "System.Byte[]") return null;
var argIndex = 0;
if (objType == null && callExp.Method.DeclaringType == typeof(Enumerable))
if (objType == null && (
callExp.Method.DeclaringType == typeof(Enumerable) ||
callExp.Method.DeclaringType.FullName == "System.MemoryExtensions"
))
{
objExp = callExp.Arguments.FirstOrDefault();
objType = objExp?.Type;

View File

@@ -112,7 +112,10 @@ namespace FreeSql.Oracle
if (objType?.FullName == "System.Byte[]") return null;
var argIndex = 0;
if (objType == null && callExp.Method.DeclaringType == typeof(Enumerable))
if (objType == null && (
callExp.Method.DeclaringType == typeof(Enumerable) ||
callExp.Method.DeclaringType.FullName == "System.MemoryExtensions"
))
{
objExp = callExp.Arguments.FirstOrDefault();
objType = objExp?.Type;

View File

@@ -112,7 +112,10 @@ namespace FreeSql.PostgreSQL
if (objType?.FullName == "System.Byte[]") return null;
var argIndex = 0;
if (objType == null && callExp.Method.DeclaringType == typeof(Enumerable))
if (objType == null && (
callExp.Method.DeclaringType == typeof(Enumerable) ||
callExp.Method.DeclaringType.FullName == "System.MemoryExtensions"
))
{
objExp = callExp.Arguments.FirstOrDefault();
objType = objExp?.Type;

View File

@@ -117,7 +117,10 @@ namespace FreeSql.QuestDb
if (objType?.FullName == "System.Byte[]") return null;
var argIndex = 0;
if (objType == null && callExp.Method.DeclaringType == typeof(Enumerable))
if (objType == null && (
callExp.Method.DeclaringType == typeof(Enumerable) ||
callExp.Method.DeclaringType.FullName == "System.MemoryExtensions"
))
{
objExp = callExp.Arguments.FirstOrDefault();
objType = objExp?.Type;

View File

@@ -111,7 +111,10 @@ namespace FreeSql.ShenTong
if (objType?.FullName == "System.Byte[]") return null;
var argIndex = 0;
if (objType == null && callExp.Method.DeclaringType == typeof(Enumerable))
if (objType == null && (
callExp.Method.DeclaringType == typeof(Enumerable) ||
callExp.Method.DeclaringType.FullName == "System.MemoryExtensions"
))
{
objExp = callExp.Arguments.FirstOrDefault();
objType = objExp?.Type;

View File

@@ -117,7 +117,10 @@ namespace FreeSql.SqlServer
if (objType?.FullName == "System.Byte[]") return null;
var argIndex = 0;
if (objType == null && callExp.Method.DeclaringType == typeof(Enumerable))
if (objType == null && (
callExp.Method.DeclaringType == typeof(Enumerable) ||
callExp.Method.DeclaringType.FullName == "System.MemoryExtensions"
))
{
objExp = callExp.Arguments.FirstOrDefault();
objType = objExp?.Type;

View File

@@ -108,7 +108,10 @@ namespace FreeSql.Sqlite
if (objType?.FullName == "System.Byte[]") return null;
var argIndex = 0;
if (objType == null && callExp.Method.DeclaringType == typeof(Enumerable))
if (objType == null && (
callExp.Method.DeclaringType == typeof(Enumerable) ||
callExp.Method.DeclaringType.FullName == "System.MemoryExtensions"
))
{
objExp = callExp.Arguments.FirstOrDefault();
objType = objExp?.Type;

View File

@@ -111,7 +111,10 @@ namespace FreeSql.TDengine
if (objType?.FullName == "System.Byte[]") return null;
var argIndex = 0;
if (objType == null && callExp.Method.DeclaringType == typeof(Enumerable))
if (objType == null && (
callExp.Method.DeclaringType == typeof(Enumerable) ||
callExp.Method.DeclaringType.FullName == "System.MemoryExtensions"
))
{
objExp = callExp.Arguments.FirstOrDefault();
objType = objExp?.Type;

View File

@@ -115,7 +115,10 @@ namespace FreeSql.Xugu
if (objType?.FullName == "System.Byte[]") return null;
var argIndex = 0;
if (objType == null && callExp.Method.DeclaringType == typeof(Enumerable))
if (objType == null && (
callExp.Method.DeclaringType == typeof(Enumerable) ||
callExp.Method.DeclaringType.FullName == "System.MemoryExtensions"
))
{
objExp = callExp.Arguments.FirstOrDefault();
objType = objExp?.Type;