Commit Graph

7 Commits

Author SHA1 Message Date
agrath@gmail.com
3a30c285fe Updated .OrderBy implementation to support OrderBy,OrderByDescending,ThenBy,ThenByDescending properly on DynamicNodeList
Usage is: @foreach(var item in home.ChildItems.OrderBy("catCount, colour desc"))
If you use the simple form of home.ChildItems.OrderBy("catCount") it will use a simpler/faster implementation
2011-02-17 19:07:22 -13:00
agrath@gmail.com
d9f420d45a Added .OrderBy method to DynamicNodeList
Only supports single pass, ascending currently, so no ThenBy implementation or Descending variants
The original query parser supports OrderBy("catCount, name desc") by nesting Expression.Call
Current implementation for DynamicNodeList supports OrderBy("catCount") only
2011-02-17 14:52:05 -13:00
agrath@gmail.com
b20d1bfd4c Added support for string Comparisons e.g. @Model.Children.Where("menuType = \"Top Menu\") and support for And/Or @Model.Children.Where("menuType == \"Top Menu\ || menuType == \"Bottom Menu\"") 2011-02-07 17:28:59 -13:00
agrath@gmail.com
e5c3c8869a Upgraded DynamicNode to do some type inferrence from the IProperty type .Value which is a string
Already had support for YesNoType (where the string value is 1 or 0) being converted/parsed to boolean
Added some TryParse calls to int and decimal respecitvely so that if a IProperty.Value is a valid decimal or int it will be returned from DynamicNode.TryGetMember as such
This enables the .Where operator to have the correct type after property retrieval so that some numerical comparisons will work

Added support for >, >=, <, <= and %[mod] to .Where
@Model.Children.Where("catCount > 1")
@Model.Children.Where("catCount % 2 == 0")
2011-02-07 13:12:34 -13:00
agrath@gmail.com
878f6fc812 Added support for some more Func<> types in my Where implementation
Refactored GenerateEqual into a Factory method HandleDynamicNodeLambdas that takes an ExpressionType
Implemented Expression.NotEqual
@Model.Children.Where("shouldBeVisible != true") => children that are hidden
2011-02-07 10:23:40 -13:00
agrath@gmail.com
6d0be45acf Changed some type comparisons where I determine if the LambdaExpression is Func<DynamicNode,object> to handle simple equality operations:
e.g. @Model.Children.Where("shouldBeVisible == true")
Also changed internal where implementation to handle Func<DynamicNode,bool> as well as Func<DynamicNode,object>
Both left & right side as lambda expressions should work (though I haven't tested this yet)
e.g. @Model.Children.Where("property1 == property2")
Only == (Expression.Equals) is supported currently due to the extra code required to invoke the lambda when generating the final comparison expression
2011-02-07 08:56:59 -13:00
agrath@gmail.com
649a98daf4 Added missing DynamicQueryable and DynamicQueryableBinders class files for previous commit 2011-02-06 19:53:07 -13:00