diff --git a/Src/Asp.Net/SqlSugar/SqlSugarClient.cs b/Src/Asp.Net/SqlSugar/SqlSugarClient.cs index 87f139e4a..1c17a7891 100644 --- a/Src/Asp.Net/SqlSugar/SqlSugarClient.cs +++ b/Src/Asp.Net/SqlSugar/SqlSugarClient.cs @@ -277,6 +277,7 @@ namespace SqlSugar else { var columns= ((object)insertDynamicObject).GetType().GetProperties().Select(it => it.Name).ToList(); + Check.Exception(columns.IsNullOrEmpty(), "Insertable.updateDynamicObject can't be null"); T insertObject = this.RewritableMethods.DeserializeObject(this.RewritableMethods.SerializeObject(insertDynamicObject)); return this.Insertable(insertObject).InsertColumns(it=> columns.Any(c=>it.Equals(c,StringComparison.CurrentCultureIgnoreCase))); } @@ -352,6 +353,7 @@ namespace SqlSugar else { var columns = ((object)updateDynamicObject).GetType().GetProperties().Select(it => it.Name).ToList(); + Check.Exception(columns.IsNullOrEmpty(), "Updateable.updateDynamicObject can't be null"); T updateObject = this.RewritableMethods.DeserializeObject(this.RewritableMethods.SerializeObject(updateDynamicObject)); return this.Updateable(updateObject).UpdateColumns(it => columns.Any(c => it.Equals(c, StringComparison.CurrentCultureIgnoreCase))); ; }