Skip to content

Commit

Permalink
madskristensen#219 Sort Categories before saving to XML
Browse files Browse the repository at this point in the history
  • Loading branch information
appetere committed Mar 28, 2016
1 parent 11ee54d commit 462ab8a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Website/app_code/code/Storage.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.Hosting;
using System.Xml.Linq;
Expand Down Expand Up @@ -43,7 +44,7 @@ public static void Save(Post post)
));

XElement categories = doc.XPathSelectElement("post/categories");
foreach (string category in post.Categories)
foreach (string category in post.Categories.OrderBy(c => c))
{
categories.Add(new XElement("category", category));
}
Expand Down

0 comments on commit 462ab8a

Please sign in to comment.