From 220701e5ea529a924ac4b075937995f84dbbe0a0 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Mon, 16 Jan 2023 15:41:11 +0800 Subject: [PATCH] Synchronization code --- Src/Asp.NetCore2/SqlSugar/Infrastructure/ContextMethods.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Src/Asp.NetCore2/SqlSugar/Infrastructure/ContextMethods.cs b/Src/Asp.NetCore2/SqlSugar/Infrastructure/ContextMethods.cs index f230dec6e..6f036e760 100644 --- a/Src/Asp.NetCore2/SqlSugar/Infrastructure/ContextMethods.cs +++ b/Src/Asp.NetCore2/SqlSugar/Infrastructure/ContextMethods.cs @@ -506,7 +506,11 @@ namespace SqlSugar private static bool IsArrayItem(Dictionary readerValues, PropertyInfo item) { - return item.PropertyType.IsArray && readerValues.Any(y => y.Key.EqualCase(item.Name)) && readerValues.FirstOrDefault(y => y.Key.EqualCase(item.Name)).Value is string; + var isArray= item.PropertyType.IsArray && readerValues.Any(y => y.Key.EqualCase(item.Name)) && readerValues.FirstOrDefault(y => y.Key.EqualCase(item.Name)).Value is string; + var isListItem = item.PropertyType.FullName.IsCollectionsList()&& + item.PropertyType.GenericTypeArguments.Length==1&& + item.PropertyType.GenericTypeArguments .First().IsClass()==false&& readerValues.FirstOrDefault(y => y.Key.EqualCase(item.Name)).Value is string; + return isArray || isListItem; } private static bool IsJsonList(Dictionary readerValues, PropertyInfo item)