Created
March 20, 2013 14:16
-
-
Save moaschterle/5204993 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web; | |
namespace Intranet | |
{ | |
public static class MenuExtensions | |
{ | |
public static IMenu NextParent(this IMenu menu) | |
{ | |
return (from xy in menu where xy.Level == Level orderby xy.Order select xy).AsEnumerable().SkipWhile(n => n.Order <= Order).Take(1).FirstOrDefault(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment