Update unit bug

This commit is contained in:
sunkaixuan 2022-04-12 16:27:23 +08:00
parent 888dd7681e
commit 43fd8fc3a5
4 changed files with 41 additions and 0 deletions

View File

@ -99,6 +99,7 @@
<Compile Include="UnitTest\Models\TestModel.cs" />
<Compile Include="UnitTest\Models\UserEntity.cs" />
<Compile Include="UnitTest\Models\UserRoleEntity.cs" />
<Compile Include="UnitTest\UCustom013.cs" />
<Compile Include="UnitTest\UCustom01.cs" />
<Compile Include="UnitTest\UCustom012.cs" />
<Compile Include="UnitTest\UCustom09.cs" />

View File

@ -31,6 +31,7 @@ namespace OrmTest
}
public static void Init()
{
UCustom013.Init();
UCustom012.Init();
UCustom09.Init();
UCustom011.Init();

View File

@ -0,0 +1,35 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OrmTest
{
public class UCustom013
{
public static void Init()
{
var db = new SqlSugarScope(new SqlSugar.ConnectionConfig()
{
ConnectionString = Config.ConnectionString,
DbType = DbType.SqlServer,
IsAutoCloseConnection = true
});
db.CodeFirst.InitTables<UnitBoola1>();
db.Queryable<Order>()
.Select(x => new
{
x1 = SqlFunc.Subqueryable<UnitBoola1>().Select(it => it.a)
}).ToList();
}
public class UnitBoola1
{
public bool a { get; set; }
}
}
}

View File

@ -552,6 +552,10 @@ namespace SqlSugar
{
return false;
}
else if ((item as MethodCallExpression).Method.Name == "Select"&& item.ToString().Contains("Subqueryable()"))
{
return false;
}
else
{
return true;