mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-05-03 20:27:56 +08:00
Update Logic Delete
This commit is contained in:
parent
6ee3ec099b
commit
357a01a9dd
@ -48,7 +48,9 @@ namespace SqlSugar
|
|||||||
List<SugarParameter> pars;
|
List<SugarParameter> pars;
|
||||||
string where;
|
string where;
|
||||||
LogicFieldName = _ExecuteCommand(LogicFieldName, out db, out where, out pars);
|
LogicFieldName = _ExecuteCommand(LogicFieldName, out db, out where, out pars);
|
||||||
var updateable = db.Updateable<T>().SetColumns(LogicFieldName, deleteValue);
|
var updateable = db.Updateable<T>();
|
||||||
|
updateable.UpdateBuilder.LambdaExpressions.ParameterIndex = 1000;
|
||||||
|
updateable .SetColumns(LogicFieldName, deleteValue);
|
||||||
updateable.SetColumns(deleteTimeFieldName, DateTime.Now);
|
updateable.SetColumns(deleteTimeFieldName, DateTime.Now);
|
||||||
updateable.SetColumns(userNameFieldName,userNameValue);
|
updateable.SetColumns(userNameFieldName,userNameValue);
|
||||||
if (pars != null)
|
if (pars != null)
|
||||||
@ -63,7 +65,9 @@ namespace SqlSugar
|
|||||||
List<SugarParameter> pars;
|
List<SugarParameter> pars;
|
||||||
string where;
|
string where;
|
||||||
LogicFieldName = _ExecuteCommand(LogicFieldName, out db, out where, out pars);
|
LogicFieldName = _ExecuteCommand(LogicFieldName, out db, out where, out pars);
|
||||||
var updateable = db.Updateable<T>().SetColumns(LogicFieldName, deleteValue);
|
var updateable = db.Updateable<T>();
|
||||||
|
updateable.UpdateBuilder.LambdaExpressions.ParameterIndex = 1000;
|
||||||
|
updateable.SetColumns(LogicFieldName, deleteValue);
|
||||||
updateable.SetColumns(deleteTimeFieldName, DateTime.Now);
|
updateable.SetColumns(deleteTimeFieldName, DateTime.Now);
|
||||||
updateable.SetColumns(userNameFieldName, userNameValue);
|
updateable.SetColumns(userNameFieldName, userNameValue);
|
||||||
if (pars != null)
|
if (pars != null)
|
||||||
@ -106,6 +110,7 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
var entityInfo = Deleteable.EntityInfo;
|
var entityInfo = Deleteable.EntityInfo;
|
||||||
db = Deleteable.Context;
|
db = Deleteable.Context;
|
||||||
|
DeleteBuilder.LambdaExpressions.ParameterIndex = 10000;
|
||||||
where = DeleteBuilder.GetWhereString.Substring(5);
|
where = DeleteBuilder.GetWhereString.Substring(5);
|
||||||
pars = DeleteBuilder.Parameters;
|
pars = DeleteBuilder.Parameters;
|
||||||
if (LogicFieldName.IsNullOrEmpty())
|
if (LogicFieldName.IsNullOrEmpty())
|
||||||
|
Loading…
Reference in New Issue
Block a user