mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-19 01:58:13 +08:00
-
This commit is contained in:
13
OrmTest/Config.cs
Normal file
13
OrmTest/Config.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OrmTest
|
||||
{
|
||||
public class Config
|
||||
{
|
||||
public static string ConnectionString = "server=.;uid=sa;pwd=sasa;database=SqlSugar4XTest";
|
||||
}
|
||||
}
|
@@ -27,12 +27,19 @@ namespace OrmTest.ExpressionTest
|
||||
|
||||
public void Q2()
|
||||
{
|
||||
ExpressionContext contet = new ExpressionContext();
|
||||
SqlSugarClient db = new SqlSugarClient(new SystemTablesConfig() { ConnectionString="x" ,DbType= DbType.SqlServer });
|
||||
db.Queryable<Student, School>((st,sc)=> new object[] {
|
||||
JoinType.Left,st.SchoolId==sc.Id
|
||||
});
|
||||
using (var db = GetInstance())
|
||||
{
|
||||
var list = db.Queryable<Student, School>((st, sc) => new object[] {
|
||||
JoinType.Left,st.SchoolId==sc.Id
|
||||
}).ToList();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlSugarClient GetInstance()
|
||||
{
|
||||
SqlSugarClient db = new SqlSugarClient(new SystemTablesConfig() { ConnectionString = Config.ConnectionString, DbType = DbType.SqlServer });
|
||||
return db;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -43,6 +43,7 @@
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Config.cs" />
|
||||
<Compile Include="ExpressionTest\ExpTestBase.cs" />
|
||||
<Compile Include="ExpressionTest\Field.cs" />
|
||||
<Compile Include="ExpressionTest\Join.cs" />
|
||||
|
Reference in New Issue
Block a user