문제

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?

도움이 되었습니까?

해결책

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

var ds = new DocumentStore();
ds.ConnectionStringName = connectionStringName;
ds.Initialize();
ds.Conventions.IdentityPartsSeparator = "-";
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top