diff --git a/SqlSugar/Abstract/InsertableProvider/InsertableProvider.cs b/SqlSugar/Abstract/InsertableProvider/InsertableProvider.cs index f2a8d1d75..f129cf7e3 100644 --- a/SqlSugar/Abstract/InsertableProvider/InsertableProvider.cs +++ b/SqlSugar/Abstract/InsertableProvider/InsertableProvider.cs @@ -75,6 +75,7 @@ namespace SqlSugar public IInsertable Where(bool isInsertNull,bool isOffIdentity=false) { + this.IsOffIdentity = IsOffIdentity; if (this.InsertBuilder.LambdaExpressions == null) this.InsertBuilder.LambdaExpressions = InstanceFactory.GetLambdaExpressions(this.Context.CurrentConnectionConfig); this.InsertBuilder.IsInsertNull = isInsertNull; diff --git a/SqlSugar/Interface/Insertable.cs b/SqlSugar/Interface/Insertable.cs index 7f0601586..9f0377ae4 100644 --- a/SqlSugar/Interface/Insertable.cs +++ b/SqlSugar/Interface/Insertable.cs @@ -15,7 +15,7 @@ namespace SqlSugar IInsertable InsertColumns(Expression> columns); IInsertable IgnoreColumns(Expression> columns); IInsertable IgnoreColumns(Func ignoreColumMethod); - IInsertable Where(bool isInsertNull); + IInsertable Where(bool isInsertNull, bool isOffIdentity = false); KeyValuePair> ToSql(); EntityInfo EntityInfo { get; set; } }