1.修正KdbndpParameter无法处理Iterator类型的bug

This commit is contained in:
tengfei8771 2023-06-14 14:44:45 +08:00
parent da406a64bb
commit 9a0d1ba378
2 changed files with 9 additions and 1 deletions

View File

@ -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)

View File

@ -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]+?\[\]");