From ebd73bb9b9d32f389c07e319eae7cfb698d1a658 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Fri, 9 Jun 2023 01:45:29 +0800 Subject: [PATCH] Optimization error prompt --- .../SqlSugar/Abstract/ExecuteNavProvider/InsertNavTask.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Src/Asp.NetCore2/SqlSugar/Abstract/ExecuteNavProvider/InsertNavTask.cs b/Src/Asp.NetCore2/SqlSugar/Abstract/ExecuteNavProvider/InsertNavTask.cs index bd7f93525..3a5473773 100644 --- a/Src/Asp.NetCore2/SqlSugar/Abstract/ExecuteNavProvider/InsertNavTask.cs +++ b/Src/Asp.NetCore2/SqlSugar/Abstract/ExecuteNavProvider/InsertNavTask.cs @@ -16,6 +16,7 @@ namespace SqlSugar public InsertNavTask Include(Expression> expression) where TChild : class, new() { + Check.ExceptionEasy(typeof(TChild).FullName.Contains("System.Collections.Generic.List`"), " need where T: class, new() ", "需要Class,new()约束,并且类属性中不能有required修饰符"); this.Context = insertNavProvider._Context; insertNavProvider.NavContext = this.NavContext; InsertNavTask result = new InsertNavTask(); @@ -39,6 +40,7 @@ namespace SqlSugar public InsertNavTask Include(Expression> expression,InsertNavOptions options) where TChild : class, new() { + Check.ExceptionEasy(typeof(TChild).FullName.Contains("System.Collections.Generic.List`"), " need where T: class, new() ", "需要Class,new()约束,并且类属性中不能有required修饰符"); this.Context = insertNavProvider._Context; insertNavProvider.NavContext = this.NavContext; InsertNavTask result = new InsertNavTask();