var documentStore = new DocumentStore();
var generator = new MultiTypeHiLoKeyGenerator(documentStore, 1024);
documentStore.Conventions.DocumentKeyGenerator = entity =>
{
var documentKey = generator.GenerateDocumentKey(documentStore.Conventions, entity);
var comment = entity as Comment;
if (comment != null)
{
return comment.PostId + "/" + documentKey;
}
return documentKey;
};
documentStore.Initialize();