mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-24 07:22:57 +08:00
Update demo
This commit is contained in:
parent
3a5a9a5e95
commit
835285be27
@ -59,8 +59,25 @@ namespace OrmTest
|
|||||||
CreateTime = null
|
CreateTime = null
|
||||||
}).Where(it => it.Id == 1).ExecuteCommand();
|
}).Where(it => it.Id == 1).ExecuteCommand();
|
||||||
|
|
||||||
|
Db.CodeFirst.InitTables<BoolTest1>();
|
||||||
|
Db.Updateable<BoolTest1>()
|
||||||
|
.SetColumns(it => it.a == !it.a)
|
||||||
|
.Where(it => it.a)
|
||||||
|
.ExecuteCommand();
|
||||||
|
|
||||||
|
Db.Updateable<BoolTest1>()
|
||||||
|
.SetColumns(it => new BoolTest1() { a = !it.a })
|
||||||
|
.Where(it => it.a)
|
||||||
|
.ExecuteCommand();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class BoolTest1
|
||||||
|
{
|
||||||
|
public bool a { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
[SugarTable("order")]
|
[SugarTable("order")]
|
||||||
public class OrderModel
|
public class OrderModel
|
||||||
{
|
{
|
||||||
|
@ -146,12 +146,16 @@ namespace OrmTest
|
|||||||
b = it.bytes,
|
b = it.bytes,
|
||||||
name="a"
|
name="a"
|
||||||
}).ToList();
|
}).ToList();
|
||||||
|
|
||||||
|
db.CodeFirst.InitTables<BoolTest1>();
|
||||||
|
db.CodeFirst.InitTables<BoolTest2>();
|
||||||
|
db.Queryable<BoolTest1>().Where(it => !it.a).ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public class UnitBytes11
|
public class UnitBytes11
|
||||||
{
|
{
|
||||||
[SugarColumn(Length =200,IsNullable =true)]
|
[SugarColumn(Length =200,IsNullable =true)]
|
||||||
public byte[] bytes { get; set; }
|
public byte[] bytes { get; set; }
|
||||||
public string name{ get; set; }
|
public string name{ get; set; }
|
||||||
|
@ -104,6 +104,16 @@ namespace OrmTest
|
|||||||
|
|
||||||
Db.CodeFirst.InitTables<Unitbluecopy>();
|
Db.CodeFirst.InitTables<Unitbluecopy>();
|
||||||
Db.Insertable(new Unitbluecopy()).UseSqlServer().ExecuteBlueCopy();
|
Db.Insertable(new Unitbluecopy()).UseSqlServer().ExecuteBlueCopy();
|
||||||
|
Db.CodeFirst.InitTables<BoolTest1>();
|
||||||
|
Db.Updateable<BoolTest1>()
|
||||||
|
.SetColumns(it =>it.a== !it.a)
|
||||||
|
.Where(it=>it.a)
|
||||||
|
.ExecuteCommand();
|
||||||
|
|
||||||
|
Db.Updateable<BoolTest1>()
|
||||||
|
.SetColumns(it=>new BoolTest1() { a = !it.a })
|
||||||
|
.Where(it => it.a)
|
||||||
|
.ExecuteCommand();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user