From 500a4d02f321959055fcff686d4aee76558cb919 Mon Sep 17 00:00:00 2001 From: 28810 <28810@YEXIANGQIN> Date: Sat, 21 Mar 2020 22:27:58 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E5=AE=8C=E5=96=84=20Internal=20=E6=96=B9?= =?UTF-8?q?=E6=B3=95=20CreateInstance?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FreeSql/Extensions/FreeSqlGlobalExtensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FreeSql/Extensions/FreeSqlGlobalExtensions.cs b/FreeSql/Extensions/FreeSqlGlobalExtensions.cs index 5aded13e..81668363 100644 --- a/FreeSql/Extensions/FreeSqlGlobalExtensions.cs +++ b/FreeSql/Extensions/FreeSqlGlobalExtensions.cs @@ -102,7 +102,7 @@ public static partial class FreeSqlGlobalExtensions if (that.IsArray) return Array.CreateInstance(that, 0); var ctorParms = that.InternalGetTypeConstructor0OrFirst(false)?.GetParameters(); if (ctorParms == null || ctorParms.Any() == false) return Activator.CreateInstance(that, null); - return Activator.CreateInstance(that, ctorParms.Select(a => a.ParameterType.IsInterface || a.ParameterType.IsAbstract ? null : Activator.CreateInstance(a.ParameterType, null)).ToArray()); + return Activator.CreateInstance(that, ctorParms.Select(a => a.ParameterType.IsInterface || a.ParameterType.IsAbstract || a.ParameterType == typeof(string) ? null : Activator.CreateInstance(a.ParameterType, null)).ToArray()); } internal static NewExpression InternalNewExpression(this Type that) {