mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-24 13:03:43 +08:00
Expression support IsNullOrWhiteSpace
This commit is contained in:
@@ -44,6 +44,7 @@ namespace OrmTest
|
|||||||
var getByFuns2 = db.Queryable<Order>().GroupBy(it => it.Name).Select(it => SqlFunc.AggregateDistinctCount(it.Price)).ToList();
|
var getByFuns2 = db.Queryable<Order>().GroupBy(it => it.Name).Select(it => SqlFunc.AggregateDistinctCount(it.Price)).ToList();
|
||||||
var getDicionary = db.Queryable<Order>().ToDictionary(it => it.Id, it => it.Name);
|
var getDicionary = db.Queryable<Order>().ToDictionary(it => it.Id, it => it.Name);
|
||||||
var getDicionaryList = db.Queryable<Order>().ToDictionaryList();
|
var getDicionaryList = db.Queryable<Order>().ToDictionaryList();
|
||||||
|
var getTest = db.Queryable<Order>().Where(it =>string.IsNullOrWhiteSpace( it.Name)).ToList();
|
||||||
Console.WriteLine("#### Examples End ####");
|
Console.WriteLine("#### Examples End ####");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -512,6 +512,10 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
name = "To" + TempParseType.Name;
|
name = "To" + TempParseType.Name;
|
||||||
}
|
}
|
||||||
|
else if (name == "IsNullOrWhiteSpace")
|
||||||
|
{
|
||||||
|
name = "IsNullOrEmpty";
|
||||||
|
}
|
||||||
switch (name)
|
switch (name)
|
||||||
{
|
{
|
||||||
case "IIF":
|
case "IIF":
|
||||||
@@ -696,6 +700,10 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
if (expression.Method.Name == "IsNullOrWhiteSpace" && expression.Method.DeclaringType == UtilConstants.StringType)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
if (expression.Method.ReflectedType().FullName != ExpressionConst.SqlFuncFullName)
|
if (expression.Method.ReflectedType().FullName != ExpressionConst.SqlFuncFullName)
|
||||||
return false;
|
return false;
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user