From 9a0d1ba3789a503233767b9a46fa580b732c40a3 Mon Sep 17 00:00:00 2001 From: tengfei8771 <532050072@qq.com> Date: Wed, 14 Jun 2023 14:44:45 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E6=AD=A3KdbndpParameter=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E5=A4=84=E7=90=86Iterator=E7=B1=BB=E5=9E=8B=E7=9A=84b?= =?UTF-8?q?ug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SqlSugar/Abstract/AdoProvider/AdoProvider.cs | 2 +- Src/Asp.NetCore2/SqlSugar/Utilities/ValidateExtensions.cs | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Src/Asp.NetCore2/SqlSugar/Abstract/AdoProvider/AdoProvider.cs b/Src/Asp.NetCore2/SqlSugar/Abstract/AdoProvider/AdoProvider.cs index e9ace4cd4..8e0a39ce3 100644 --- a/Src/Asp.NetCore2/SqlSugar/Abstract/AdoProvider/AdoProvider.cs +++ b/Src/Asp.NetCore2/SqlSugar/Abstract/AdoProvider/AdoProvider.cs @@ -1606,7 +1606,7 @@ namespace SqlSugar if (item.Value != null) { var type = item.Value.GetType(); - if ((type != UtilConstants.ByteArrayType && type.IsArray&&item.IsArray==false) || type.FullName.IsCollectionsList()) + if ((type != UtilConstants.ByteArrayType && type.IsArray&&item.IsArray==false) || type.FullName.IsCollectionsList()||type.IsIterator()) { var newValues = new List(); foreach (var inValute in item.Value as IEnumerable) diff --git a/Src/Asp.NetCore2/SqlSugar/Utilities/ValidateExtensions.cs b/Src/Asp.NetCore2/SqlSugar/Utilities/ValidateExtensions.cs index 8ae5209a0..68a093aff 100644 --- a/Src/Asp.NetCore2/SqlSugar/Utilities/ValidateExtensions.cs +++ b/Src/Asp.NetCore2/SqlSugar/Utilities/ValidateExtensions.cs @@ -153,6 +153,14 @@ namespace SqlSugar { return (thisValue + "").StartsWith("System.Collections.Generic.List")|| (thisValue + "").StartsWith("System.Collections.Generic.IEnumerable"); } + public static bool IsIterator(this Type type) + { + if (type.BaseType.IsGenericType) + { + return type.BaseType.GetGenericTypeDefinition().FullName == "System.Linq.Enumerable+Iterator`1"; + } + return false; + } public static bool IsStringArray(this string thisValue) { return (thisValue + "").IsMatch(@"System\.[a-z,A-Z,0-9]+?\[\]");