Update demo

This commit is contained in:
sunkaixuan 2019-05-28 18:13:08 +08:00
parent cf7525aa1c
commit d670f1d16b

View File

@ -23,13 +23,18 @@ namespace OrmTest
Db.Updateable<BoolTest>().SetColumns(it => it.BoolValue == x.BoolValue).Where(it => it.Id == 1).ExecuteCommand();
Db.Updateable<BoolTest>().SetColumns(it => new BoolTest() { BoolValue = !x.BoolValue }).Where(it => it.Id == 1).ExecuteCommand();
Db.Updateable<BoolTest>().SetColumns(it => it.BoolValue == !x.BoolValue).Where(it => it.Id == 1).ExecuteCommand();
Db.Updateable<BoolTest>(x).ReSetValue(it => it.BoolValue == it.BoolValue).ExecuteCommand();
Db.Updateable<BoolTest>(x).ReSetValue(it => it.BoolValue == true).ExecuteCommand();
Db.Updateable<BoolTest>(x).ReSetValue(it => it.BoolValue == !it.BoolValue).ExecuteCommand();
}
}
public class BoolTest
{
[SugarColumn(IsPrimaryKey =true)]
public int Id { get; set; }
public bool BoolValue { get; set; }
public string Name { get; set; }
}
/// <summary>
/// 普通用户表