mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-24 07:22:57 +08:00
增加更新操作测试代码
This commit is contained in:
parent
6a489b4cb4
commit
8bb6e94fd1
@ -124,6 +124,15 @@ namespace DB2CoreTest.CURD
|
|||||||
}).OrderBy(ui => ui.UserName).ToList();
|
}).OrderBy(ui => ui.UserName).ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void Updateable()
|
||||||
|
{
|
||||||
|
// 获取新的数据库实例
|
||||||
|
var db = DbHelper.GetNewDb();
|
||||||
|
|
||||||
|
//更新用户
|
||||||
|
var ret = db.Updateable<UserInfo>(p => p.UserName == "test").Where(p => p.UserName == "admin").ExecuteCommand();
|
||||||
|
}
|
||||||
|
|
||||||
public static void Deleteable()
|
public static void Deleteable()
|
||||||
{
|
{
|
||||||
// 获取新的数据库实例
|
// 获取新的数据库实例
|
||||||
|
@ -5,13 +5,14 @@ public class Program
|
|||||||
{
|
{
|
||||||
static void Main(string[] args)
|
static void Main(string[] args)
|
||||||
{
|
{
|
||||||
CodeFirst.Init();
|
//CodeFirst.Init();
|
||||||
CodeFirst.Insertable();
|
CodeFirst.Insertable();
|
||||||
CodeFirst.Queryable();
|
CodeFirst.Queryable();
|
||||||
CodeFirst.JoinQuery();
|
CodeFirst.JoinQuery();
|
||||||
CodeFirst.PageQuery();
|
CodeFirst.PageQuery();
|
||||||
CodeFirst.OrderBy();
|
CodeFirst.OrderBy();
|
||||||
CodeFirst.GroupBy();
|
CodeFirst.GroupBy();
|
||||||
|
CodeFirst.Updateable();
|
||||||
CodeFirst.Deleteable();
|
CodeFirst.Deleteable();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user