Browse Source

Update Demo

pull/12/MERGE
sunkaixuan 7 years ago
parent
commit
4333bfd90b
  1. 8
      Src/Asp.Net/MySqlTest/UnitTest/Update.cs
  2. 2
      Src/Asp.Net/SqliteTest/Config.cs
  3. BIN
      Src/Asp.Net/SqliteTest/DataBase/SqlSugar4xTest.sqlite
  4. 8
      Src/Asp.Net/SqliteTest/UnitTest/Update.cs

8
Src/Asp.Net/MySqlTest/UnitTest/Update.cs

@ -116,10 +116,10 @@ namespace OrmTest.UnitTest
string name = "x"; string name = "x";
var t10 = db.Updateable<Student>().UpdateColumns(it => new Student() { Name =name, SchoolId=updateObj.SchoolId }).Where(it=>it.Id==11).ToSql(); var t10 = db.Updateable<Student>().UpdateColumns(it => new Student() { Name =name, SchoolId=updateObj.SchoolId }).Where(it=>it.Id==11).ToSql();
base.Check(@"UPDATE `STudent` SET base.Check(@"UPDATE `STudent` SET
`SchoolId` = @Const0 , `Name` = @const3 WHERE ( `ID` = @Id1 )", new List<SugarParameter>() { `SchoolId` = @Const1 , `Name` = @Const0 WHERE ( `ID` = @Id2 )", new List<SugarParameter>() {
new SugarParameter("@const3","x"), new SugarParameter("@Const1",18),
new SugarParameter("@Const0",18), new SugarParameter("@Const0","x"),
new SugarParameter("@Id1",11)}, new SugarParameter("@Id2",11)},
t10.Key, t10.Key,
t10.Value, t10.Value,
"Update 10 error" "Update 10 error"

2
Src/Asp.Net/SqliteTest/Config.cs

@ -8,6 +8,6 @@ namespace OrmTest
{ {
public class Config public class Config
{ {
public static string ConnectionString = @"DataSource=F:\MyOpenSource\SqlSugar4.XNew\SqlSugar\Src\Asp.Net\SqliteTest\DataBase\SqlSugar4xTest.sqlite"; public static string ConnectionString = @"DataSource=D:\MyGit\SqlSugar\Src\Asp.Net\SqliteTest\DataBase\SqlSugar4xTest.sqlite";
} }
} }

BIN
Src/Asp.Net/SqliteTest/DataBase/SqlSugar4xTest.sqlite

Binary file not shown.

8
Src/Asp.Net/SqliteTest/UnitTest/Update.cs

@ -116,10 +116,10 @@ namespace OrmTest.UnitTest
string name = "x"; string name = "x";
var t10 = db.Updateable<Student>().UpdateColumns(it => new Student() { Name =name, SchoolId=updateObj.SchoolId }).Where(it=>it.Id==11).ToSql(); var t10 = db.Updateable<Student>().UpdateColumns(it => new Student() { Name =name, SchoolId=updateObj.SchoolId }).Where(it=>it.Id==11).ToSql();
base.Check(@"UPDATE `STudent` SET base.Check(@"UPDATE `STudent` SET
`SchoolId` = @Const0 , `Name` = @const3 WHERE ( `ID` = @Id1 )", new List<SugarParameter>() { `SchoolId` = @Const1 , `Name` = @Const0 WHERE ( `ID` = @Id2 )", new List<SugarParameter>() {
new SugarParameter("@const3","x"), new SugarParameter("@Const1",18),
new SugarParameter("@Const0",18), new SugarParameter("@Const0","x"),
new SugarParameter("@Id1",11)}, new SugarParameter("@Id2",11)},
t10.Key, t10.Key,
t10.Value, t10.Value,
"Update 10 error" "Update 10 error"

Loading…
Cancel
Save