Browse Source

Update error message

pull/33/head
sunkaixuan 1 year ago
parent
commit
f13035db24
  1. 2
      Src/Asp.NetCore2/SqlSugar/SqlSugarClient.cs

2
Src/Asp.NetCore2/SqlSugar/SqlSugarClient.cs

@ -184,7 +184,7 @@ namespace SqlSugar
public IInsertable<T> Insertable<T>(T insertObj) where T : class, new() public IInsertable<T> Insertable<T>(T insertObj) where T : class, new()
{ {
Check.Exception(typeof(T).FullName.Contains("System.Collections.Generic.List`"), " need where T: class, new() "); Check.ExceptionEasy(typeof(T).FullName.Contains("System.Collections.Generic.List`"), " need where T: class, new() ","需要Class,new()约束,并且类属性中不能有required修饰符");
if (typeof(T).Name == "Object") if (typeof(T).Name == "Object")
{ {
Check.ExceptionEasy("Object type use db.InsertableByObject(obj).ExecuteCommand()", "检测到T为Object类型,请使用 db.InsertableByObject(obj).ExecuteCommand(),Insertable不支持object,InsertableByObject可以(缺点:功能比较少)"); Check.ExceptionEasy("Object type use db.InsertableByObject(obj).ExecuteCommand()", "检测到T为Object类型,请使用 db.InsertableByObject(obj).ExecuteCommand(),Insertable不支持object,InsertableByObject可以(缺点:功能比较少)");

Loading…
Cancel
Save