Browse Source

Updadte Demo

pull/12/MERGE
610262374@qq.com 6 years ago
parent
commit
bf881059a0
  1. 36
      Src/Asp.Net/SqlServerTest/BugTest/Bug2.cs
  2. 9
      Src/Asp.Net/SqlServerTest/Program.cs
  3. 1
      Src/Asp.Net/SqlServerTest/SqlServerTest.csproj

36
Src/Asp.Net/SqlServerTest/BugTest/Bug2.cs

@ -0,0 +1,36 @@
using OrmTest.Models;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace OrmTest.BugTest
{
public class Bug2
{
public SqlSugarClient DB
{
get {
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
{
InitKeyType = InitKeyType.Attribute,
ConnectionString = Config.ConnectionString,
DbType = DbType.SqlServer,
IsAutoCloseConnection = true
});
return db;
}
}
public void Init() {
var x2= DB.Queryable<School>().Where(x => x.Id == SqlFunc.Subqueryable<School>().Where(y => y.Id == SqlFunc.Subqueryable<Student>().Where(yy => y.Id == x.Id).Select(yy => yy.Id)).Select(y => y.Id)).ToSql();
if (!x2.Key.Contains("STudent")) {
throw new Exception("bug2 error");
}
}
}
}

9
Src/Asp.Net/SqlServerTest/Program.cs

@ -18,7 +18,11 @@ namespace OrmTest
static void Main(string[] args) static void Main(string[] args)
{ {
// /***Unit Test***/ /***BUG repair test***/
new BugTest.Bug1().Init();
new BugTest.Bug2().Init();
/***Unit Test***/
new SqlRemark(2).Init(); new SqlRemark(2).Init();
new Select(1).Init(); new Select(1).Init();
new Field(1).Init(); new Field(1).Init();
@ -56,9 +60,6 @@ namespace OrmTest
Demo.Mapper.Init(); Demo.Mapper.Init();
Demo.ExtEntity.Init(); Demo.ExtEntity.Init();
Demo.VersionValidation.Init(); Demo.VersionValidation.Init();
/***BUG repair test***/
new BugTest.Bug1().Init();
} }
} }
} }

1
Src/Asp.Net/SqlServerTest/SqlServerTest.csproj

@ -49,6 +49,7 @@
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="BugTest\Bug2.cs" />
<Compile Include="Models\Brand.cs" /> <Compile Include="Models\Brand.cs" />
<Compile Include="BugTest\Bug1.cs" /> <Compile Include="BugTest\Bug1.cs" />
<Compile Include="Models\VendorAndBrand.cs" /> <Compile Include="Models\VendorAndBrand.cs" />

Loading…
Cancel
Save