using System.Collections.Generic; using System.Linq; using Start.Server.Models; namespace Start.Server.Extensions { public static class SortingExtensions { public static IEnumerable SortContainers( this IEnumerable bookmarkContainers) { return bookmarkContainers .OrderBy(bc => bc.SortOrder) .ThenBy(bc => bc.BookmarkContainerId); } public static IEnumerable SortGroups( this IEnumerable bookmarkGroups) { return bookmarkGroups .OrderBy(bg => bg.SortOrder) .ThenBy(bg => bg.BookmarkGroupId); } public static IEnumerable SortBookmarks( this IEnumerable bookmarks) { return bookmarks .OrderBy(b => b.SortOrder) .ThenBy(b => b.BookmarkId); } } }