Update Updateable

This commit is contained in:
sunkaixuan
2019-04-21 20:15:07 +08:00
parent 152e779bfa
commit 599456fcda
9 changed files with 51 additions and 25 deletions

View File

@@ -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";
}
}

View File

@@ -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();
}
}
}