mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-10-26 10:49:20 +08:00
Update exp to sql
This commit is contained in:
@@ -15,9 +15,19 @@ namespace OrmTest
|
||||
Db.DbMaintenance.TruncateTable<SYS_USER>();
|
||||
Db.Insertable(new SYS_USER() { USER_ID=1,USER_ACCOUNT = "a", USER_PWD = "b", USER_NAME = "c", PWD_LASTCHTIME = DateTime.Now, PWD_ERRORCOUNT = 1, PWD_LASTERRTIME = DateTime.Now }).ExecuteCommand();
|
||||
Db.Updateable(new SYS_USER() { USER_ID=1, PWD_LASTERRTIME = null }).WhereColumns(it=> new{ it.PWD_ERRORCOUNT, it.PWD_LASTERRTIME }).ExecuteCommand();
|
||||
|
||||
Db.CodeFirst.InitTables(typeof(BoolTest));
|
||||
var x = new BoolTest();
|
||||
Db.Updateable<BoolTest>().SetColumns(it => new BoolTest() { BoolValue = !it.BoolValue }).Where(it=>it.Id==1).ExecuteCommand();
|
||||
|
||||
Db.Updateable<BoolTest>().SetColumns(it => it.BoolValue == !it.BoolValue ).Where(it=>it.Id==1).ExecuteCommand();
|
||||
}
|
||||
}
|
||||
|
||||
public class BoolTest
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public bool BoolValue { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 普通用户表
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user