Update logic delete bug

This commit is contained in:
sunkaixuna
2021-11-21 12:10:44 +08:00
parent 3c12bbee84
commit b4333c2fe2
4 changed files with 22 additions and 3 deletions

View File

@@ -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 ####");
}

View File

@@ -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; }
}
}
}