mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-24 18:04:52 +08:00
-
This commit is contained in:
parent
3ec6e13189
commit
9adead851e
44
SqlServerTest/Models/DataTestInfo2.cs
Normal file
44
SqlServerTest/Models/DataTestInfo2.cs
Normal file
@ -0,0 +1,44 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace OrmTest.Models
|
||||
{
|
||||
///<summary>
|
||||
///
|
||||
///</summary>
|
||||
public class DataTestInfo2
|
||||
{
|
||||
public DataTestInfo2(){
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// Desc:
|
||||
/// Default:
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
public Guid PK {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:
|
||||
/// Default:
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
public bool Bool1 {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public bool? Bool2 {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string Text1 {get;set;}
|
||||
|
||||
}
|
||||
}
|
@ -55,6 +55,7 @@
|
||||
<Compile Include="Demos\Query.cs" />
|
||||
<Compile Include="Demos\Update.cs" />
|
||||
<Compile Include="Models\DataTestInfo.cs" />
|
||||
<Compile Include="Models\DataTestInfo2.cs" />
|
||||
<Compile Include="Models\ViewModelStudent.cs" />
|
||||
<Compile Include="PerformanceTesting\PerformanceBase.cs" />
|
||||
<Compile Include="PerformanceTesting\SqlSugarPerformance.cs" />
|
||||
|
@ -32,6 +32,7 @@ namespace OrmTest.UnitTest
|
||||
whereSingle9(new Student() { Id = 1 });
|
||||
whereSingle10();
|
||||
whereSingle11();
|
||||
whereSingle12();
|
||||
WhereMultiple1();
|
||||
WhereMultiple2();
|
||||
|
||||
@ -207,6 +208,19 @@ namespace OrmTest.UnitTest
|
||||
|
||||
}, "whereSingle11");
|
||||
}
|
||||
|
||||
private void whereSingle12()
|
||||
{
|
||||
Expression<Func<DataTestInfo2, bool>> exp = it => it.Bool1==true;
|
||||
ExpressionContext expContext = new ExpressionContext();
|
||||
expContext.Resolve(exp, ResolveExpressType.WhereSingle);
|
||||
var value = expContext.Result.GetString();
|
||||
var pars = expContext.Parameters;
|
||||
base.Check(value, pars, "( [Bool1] = @Bool10 )", new List<SugarParameter>()
|
||||
{
|
||||
new SugarParameter("@Bool10",true)
|
||||
}, "whereSingle12");
|
||||
}
|
||||
}
|
||||
|
||||
public class WhereConst
|
||||
|
Loading…
Reference in New Issue
Block a user