Browse Source

-

pull/12/MERGE
sunkaixuan 8 years ago
parent
commit
9adead851e
  1. 44
      SqlServerTest/Models/DataTestInfo2.cs
  2. 1
      SqlServerTest/SqlServerTest.csproj
  3. 14
      SqlServerTest/UnitTest/ExpressionTest/Where.cs

44
SqlServerTest/Models/DataTestInfo2.cs

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

1
SqlServerTest/SqlServerTest.csproj

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

14
SqlServerTest/UnitTest/ExpressionTest/Where.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…
Cancel
Save