Browse Source

Update Demo

pull/12/MERGE
sunkaixuan 6 years ago
parent
commit
7624007309
  1. 2
      Src/Asp.Net/SqlServerTest/SqlServerTest.csproj
  2. 4
      Src/Asp.Net/SqlServerTest/UnitTest/UJson.cs
  3. 2
      Src/Asp.Net/SqlServerTest/UnitTest/UValidate.cs

2
Src/Asp.Net/SqlServerTest/SqlServerTest.csproj

@ -140,7 +140,7 @@
<Compile Include="OldTest\UnitTest\Setting\MapColumn.cs" /> <Compile Include="OldTest\UnitTest\Setting\MapColumn.cs" />
<Compile Include="OldTest\UnitTest\Setting\MapTable.cs" /> <Compile Include="OldTest\UnitTest\Setting\MapTable.cs" />
<Compile Include="OldTest\UnitTest\Update.cs" /> <Compile Include="OldTest\UnitTest\Update.cs" />
<Compile Include="UnitTest\ObjectsValidate.cs" /> <Compile Include="UnitTest\UValidate.cs" />
<Compile Include="UnitTest\UJson.cs" /> <Compile Include="UnitTest\UJson.cs" />
<Compile Include="UnitTest\Main.cs" /> <Compile Include="UnitTest\Main.cs" />
<Compile Include="UnitTest\UThread.cs" /> <Compile Include="UnitTest\UThread.cs" />

4
Src/Asp.Net/SqlServerTest/UnitTest/UJson.cs

@ -15,10 +15,10 @@ namespace OrmTest
Db.DbMaintenance.TruncateTable<JsonTest>(); Db.DbMaintenance.TruncateTable<JsonTest>();
Db.Insertable(new JsonTest() { Order = new Order { Id = 1, Name = "order1" } }).ExecuteCommand(); Db.Insertable(new JsonTest() { Order = new Order { Id = 1, Name = "order1" } }).ExecuteCommand();
var list = Db.Queryable<JsonTest>().ToList(); var list = Db.Queryable<JsonTest>().ToList();
ObjectsValidate.Check("order1", list.First().Order.Name, "Json"); UValidate.Check("order1", list.First().Order.Name, "Json");
Db.Updateable(new JsonTest() { Id = 1, Order = new Order { Id = 2, Name = "order2" } }).ExecuteCommand(); Db.Updateable(new JsonTest() { Id = 1, Order = new Order { Id = 2, Name = "order2" } }).ExecuteCommand();
list= Db.Queryable<JsonTest>().ToList(); list= Db.Queryable<JsonTest>().ToList();
ObjectsValidate.Check("order2", list.First().Order.Name, "Json"); UValidate.Check("order2", list.First().Order.Name, "Json");
var list2 = Db.Queryable<JsonTest>().ToList(); var list2 = Db.Queryable<JsonTest>().ToList();
} }
} }

2
Src/Asp.Net/SqlServerTest/UnitTest/ObjectsValidate.cs → Src/Asp.Net/SqlServerTest/UnitTest/UValidate.cs

@ -6,7 +6,7 @@ using System.Threading.Tasks;
namespace OrmTest namespace OrmTest
{ {
public class ObjectsValidate public class UValidate
{ {
public static void Check(object a, object b, object name) public static void Check(object a, object b, object name)
{ {
Loading…
Cancel
Save