mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-19 10:08:19 +08:00
Update Updateable
This commit is contained in:
@@ -8,8 +8,8 @@ namespace OrmTest
|
||||
{
|
||||
public class Config
|
||||
{
|
||||
public static string ConnectionString = "server=localhost;Database=SqlSugar4xTest;Uid=root;Pwd=haosql";
|
||||
public static string ConnectionString2 = "server=localhost;Database=SQLSUGAR4XTEST;Uid=root;Pwd=haosql";
|
||||
public static string ConnectionString3 = "server=localhost;Database=sqlsugar4xtest;Uid=root;Pwd=haosql";
|
||||
public static string ConnectionString = "server=localhost;Database=SqlSugar4xTest;Uid=root;Pwd=root";
|
||||
public static string ConnectionString2 = "server=localhost;Database=SQLSUGAR4XTEST;Uid=root;Pwd=root";
|
||||
public static string ConnectionString3 = "server=localhost;Database=sqlsugar4xtest;Uid=root;Pwd=root";
|
||||
}
|
||||
}
|
||||
|
@@ -58,6 +58,13 @@ namespace OrmTest.Demo
|
||||
|
||||
//Column is null no update
|
||||
db.Updateable(updateObj).Where(true).ExecuteCommand();
|
||||
|
||||
|
||||
db.Updateable(new Student[] { new Student() { Id = 2, Name = "a2" }, new Student() { Id = 1, Name = "a1" } })
|
||||
.UpdateColumns(it => new { it.Name, it.Id, it.SchoolId })
|
||||
.WhereColumns(it=>new { it.SchoolId})
|
||||
.Where(it => it.Id == 1)
|
||||
.ExecuteCommand();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user