public void Sort(List<string> items)
{
// replace all underscore with slash
string[] ids = items.Select(key => key.Replace("_", "/")).ToArray();
// load all documents
using (IDocumentSession session = this.documentStore.OpenSession())
{
IPage[] documents = session.Load<IPage>(ids.ToArray());
int order = 1;
foreach (IPage model in documents)
{
model.Metadata.SortOrder = order++;
}
session.SaveChanges();
}
}