This commit is contained in:
sunkaixuan
2017-10-10 10:24:48 +08:00
parent dca2f81894
commit dccd895c92
2 changed files with 17 additions and 5 deletions

View File

@@ -21,6 +21,7 @@ namespace OrmTest.UnitTest
base.Begin(); base.Begin();
for (int i = 0; i < base.Count; i++) for (int i = 0; i < base.Count; i++)
{ {
whereSingle26();
whereSingle25(); whereSingle25();
whereSingle24(); whereSingle24();
whereSingle23(); whereSingle23();
@@ -391,6 +392,20 @@ namespace OrmTest.UnitTest
new SugarParameter("@Datetime10",DateTime.Now.Date) new SugarParameter("@Datetime10",DateTime.Now.Date)
}, "whereSingle24"); }, "whereSingle24");
} }
private void whereSingle26()
{
var p = DateTime.Now;
Expression<Func<DataTestInfo2, bool>> exp = it => it.Bool1&&it.Bool1;
SqlServerExpressionContext expContext = new SqlServerExpressionContext();
expContext.Resolve(exp, ResolveExpressType.WhereSingle);
var value = expContext.Result.GetString();
var pars = expContext.Parameters;
base.Check(value, pars, "( CAST( DateName(Year,[Datetime1]) +'-'+ DateName(Month,[Datetime1]) +'-'+ DateName(Day,[Datetime1]) AS DATETIME) > @Date0 )", new List<SugarParameter>()
{
new SugarParameter("@Date0",DateTime.Now.Date),
}, "whereSingle26");
}
private void whereSingle25() private void whereSingle25()
{ {
var p = DateTime.Now; var p = DateTime.Now;
@@ -403,7 +418,7 @@ namespace OrmTest.UnitTest
{ {
new SugarParameter("@Date0",DateTime.Now.Date), new SugarParameter("@Date0",DateTime.Now.Date),
}, "whereSingle24"); }, "whereSingle25");
} }
} }

View File

@@ -6,10 +6,7 @@ using System.Text;
namespace SqlSugar namespace SqlSugar
{ {
/// <summary>
/// 开发中....
/// </summary>
/// <typeparam name="T"></typeparam>
public class Subqueryable<T> where T : class, new() public class Subqueryable<T> where T : class, new()
{ {
public Subqueryable<T> Where(Func<T, bool> expression) public Subqueryable<T> Where(Func<T, bool> expression)