Fixed .OrderBy with single properties which are implemented as actual properties (e.g. Level, CreateDate, UpdateDate) - dynamic properties should have ordered correctly

This commit is contained in:
agrath@gmail.com
2011-03-25 09:47:00 -13:00
parent ddf97c30d1
commit 10672f02a1

View File

@@ -166,6 +166,10 @@ namespace System.Linq.Dynamic
{
value = (firstFuncResult as Func<DynamicNode, object>)(node);
}
if (firstFuncResult.GetType().IsValueType)
{
value = firstFuncResult;
}
return value;
}).AsQueryable();
}
@@ -179,6 +183,10 @@ namespace System.Linq.Dynamic
{
value = (firstFuncResult as Func<DynamicNode, object>)(node);
}
if (firstFuncResult.GetType().IsValueType)
{
value = firstFuncResult;
}
return value;
}).AsQueryable();
}
@@ -1101,8 +1109,8 @@ namespace System.Linq.Dynamic
var not = Expression.Not(Expression.TypeAs(invokedExpr, typeof(Nullable<bool>)));
expr = Expression.Lambda<Func<DynamicNode, bool>>(
Expression.Condition(
Expression.Property(not, "HasValue"),
Expression.Property(not, "Value"),
Expression.Property(not, "HasValue"),
Expression.Property(not, "Value"),
Expression.Constant(false, typeof(bool))
), parameters);
}