Updadte Demo

This commit is contained in:
610262374@qq.com 2019-01-10 18:46:59 +08:00
parent 326cffa0bc
commit bf881059a0
3 changed files with 42 additions and 4 deletions

View File

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

View File

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

View File

@ -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" />