Mugshot

Hey I'm Lee. My blog was put up to house useful nuggets I could refer back to, document my learning curves on new technologies and house tutorials I write for Umbraco and other .NET stuff.

All thoughts and comments on here are my own, and in no way reflect my employer - I also take no responsibility for spelling, grammar or terminology, so read at your own risk!

Blogs I Read

Sites I Like

Filter & Sorting Using NodeFactory

This isn't really a blog, just me posting up some code that I always seem to forget!  If you are not using Linq2Umbraco and sticking with Nodefactory (Shame on you), then you can still make use of Lamba Expressions and do some cool stuff with the data just using Nodefactory

Sorting Nodes By Created Date

// Get the latest BluRay parent node
Node myNode = new Node(1121);

// Now get all the children
Nodes SubPages = myNode.Children;

// Now use a lambda expression to sort the nodes by create date
var subPages = myNode.Children.Cast<Node>().OrderBy(x => x.CreateDate);

And just to show you get all the VS intellisense goodness [more]

Untitled-1

And even better…

Untitled-2

Kudos goes to the Australian legend Aaron for showing me how to do this.

Back to top