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..975f0aa97 100644 --- a/Src/Asp.NetCore2/SqlSugar/Utilities/ValidateExtensions.cs +++ b/Src/Asp.NetCore2/SqlSugar/Utilities/ValidateExtensions.cs @@ -153,6 +153,18 @@ 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 == null) + { + return false; + } + 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]+?\[\]");