From 7addc23a6f744addbb66b8910df3ab3f9b19100e Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Thu, 14 Jul 2022 13:15:38 +0800 Subject: [PATCH] Adding constraints --- Src/Asp.Net/SqlSugar/Utilities/UtilMethods.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Src/Asp.Net/SqlSugar/Utilities/UtilMethods.cs b/Src/Asp.Net/SqlSugar/Utilities/UtilMethods.cs index 4c6567a63..8ff8b35f1 100644 --- a/Src/Asp.Net/SqlSugar/Utilities/UtilMethods.cs +++ b/Src/Asp.Net/SqlSugar/Utilities/UtilMethods.cs @@ -823,7 +823,10 @@ namespace SqlSugar public static void CheckArray(T[] insertObjs) where T : class, new() { - if (insertObjs != null && insertObjs.Length == 1 && insertObjs.FirstOrDefault().GetType().FullName.Contains("System.Collections.Generic.List`")) + if (insertObjs != null + && insertObjs.Length == 1 + && insertObjs.FirstOrDefault()!=null + && insertObjs.FirstOrDefault().GetType().FullName.Contains("System.Collections.Generic.List`")) { Check.ExceptionEasy("Insertable(T []) is an array and your argument is a List", "二次封装引起的进错重载,当前方法是 Insertable(T []) 参数是一个数组,而你的参数是一个List"); }