Browse Source
!35 修正KdbndpParameter无法处理Iterator类型的bug
Merge pull request !35 from 可爱又迷人的反派角色/master
pull/36/head
sunkaixuan
1 year ago
committed by
Gitee
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with
13 additions and
1 deletions
-
Src/Asp.NetCore2/SqlSugar/Abstract/AdoProvider/AdoProvider.cs
-
Src/Asp.NetCore2/SqlSugar/Utilities/ValidateExtensions.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<string>(); |
|
|
|
foreach (var inValute in item.Value as IEnumerable) |
|
|
|
|
|
@ -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]+?\[\]"); |
|
|
|