Pergunta

i have downloaded sample mvc application from here http://ravenmvc.codeplex.com/releases/view/45994

It works just fine. But i have a question. In sample application DocumentId looks like "categories-2", but in my application after i call Store method:

        using (var session = DocumentStore.OpenSession())
        {
            session.Store(item);
            session.SaveChanges();
            return item;
        }

i have DocumentId like "projects/3073". I want to have DocumentId in format just like in sample application. How i can do that? Is there some option i should change?

Foi útil?

Solução

You need to set the DocumentConvention when you initialize your DocumentStore:

var ds = new DocumentStore();
ds.ConnectionStringName = connectionStringName;
ds.Initialize();
ds.Conventions.IdentityPartsSeparator = "-";
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top