mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-11-08 18:34:55 +08:00
Update logic delete bug
This commit is contained in:
@@ -100,6 +100,7 @@ namespace OrmTest
|
||||
//Where Sql
|
||||
//db.Updateable(updateObj).Where("id=@x", new { x = "1" }).ExecuteCommand();
|
||||
|
||||
db.Updateable<Order>().SetColumns("name", 1).Where(it => it.Id == 1).ExecuteCommand();
|
||||
Console.WriteLine("#### Updateable End ####");
|
||||
}
|
||||
|
||||
|
||||
@@ -41,8 +41,19 @@ namespace OrmTest
|
||||
//by expression
|
||||
db.Deleteable<Order>().Where(it => it.Id == 11111).ExecuteCommand();
|
||||
|
||||
//logic delete
|
||||
db.CodeFirst.InitTables<LogicDeleteTezt>();
|
||||
db.Deleteable<LogicDeleteTezt>().Where(it=>it.Name=="a").IsLogic().ExecuteCommand();
|
||||
Console.WriteLine("#### Deleteable End ####");
|
||||
|
||||
}
|
||||
|
||||
public class LogicDeleteTezt
|
||||
{
|
||||
public string Name { get; set; }
|
||||
[SugarColumn(IsPrimaryKey =true)]
|
||||
public int Id { get; set; }
|
||||
public bool IsDeleted { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user