Allows this syntax to work now:
@Model.Children.Where("updateDate < DateTime.Now.AddDays(-2)")
This didn't work previously in 4.7beta because updateDate was still boxed as an object and object < DateTime can't be implicitly converted
@Model.Children.Where("bodyText.Contains('ipsum')") still doesn't work because the parser doesn't know how to invoke .Contains on a LambdaExpression (yet)
DynamicNodeWalker is our secret weapon in the fight against the Rebel XSLT Alliance
Navigate nodes by calling Up(), Down(), Next() and Previous() on them
Next(1) will jump two items along within the current list, whereas Next() will walk by one within the list
Previous(1) will move two items backwards within the current list
Up() is a special wrapper around .Parent which has an overload .Up(int) to replace @Model.Parent.Parent.Parent... [.Up(2)]
Down() will take you to the first Child item and is equivilent to .Children.First(), use .Down(1) to replace .Children.First().Children
If one of the NodeWalker functions fails to find a node at the requested position, it will return null
Fixed DynamicNodeList.OrderBy where there was only one column and the ordering was descending
Added DateTime.TryParse support to DynamicNode property retrieval to allow OrderBy and Where to have date support
Added IsProtected & HasAccess to DynamicNode
Added .AncestorsOrSelf to DynamicNode
Added .Descendants to DynamicNode [Deep Children]
Added .DescendantsAndSelf [Deep Children]
Fixed .nodeTypeAlias children collection crashing when the node didn't contain any children of that type
Added cshtml templates first versions for DynamicNode, these are samples I demo'ed at the Auckland umbraco meetup the night of 4.7beta release
Added documentElement checking to DynamicXml convert for DynamicNode property get to solve a potential issue with XHTML RTEs
Fixed issue with calling @Model.Children.First() in testing (null Children in testing)
Put some commented placeholder code in .XPath->DynamicNodeList inside DynamicNode.cs for future return of DynamicXml if not valid List<NodeFactory.Node>
Decided that if using @Model.XPath and you were in testing, then the resulting DynamicNodeList should contain self/this, not be empty
Should allow chaining to work when in test mode
Fixed a potential issue when DynamicNode got returned during testing because there are no children
and then property accesses would return false causing chaining to break
Added [a somewhat experimental] DynamicXml and xml fragment detection within DynamicNode to DynamicXml,
When accessing a string property that contains XML, you can now continue your dot based access
Call .ToXml() to get the real XML string again
Call .XPath(string) to run a XPath query on the fragment and return another DynamicXml
Example:
<Catalog>
<Book id="bk101">
<Author>Garghentini, Davide</Author>
<Title>XML Developer's Guide</Title>
<Genre>Computer</Genre>
...
@Model.Children.Random().someXmlProperty.Catalog.Book[1].Genre
@Model.Children.Random().someXmlProperty.Book[1].XPath(".//Genre")
@Model.Children.Random().someXmlProperty.Book[1].ToXml()
Nodes are attempted to be turned back into NodeFactory.Node when returned by XPath and then wrapped in DynamicNode and then DynamicNodeList
Added .Random parameterless overload to pick a single random node from the DynamicNodeList
Example of new Methods being used:
<img src='@Model.XPath("//ChildItem[catCount = 2]").Random().Media("catPicture","umbracoFile")'/>