Problem with DocumentId in RavenDB
-
09-10-2019 - |
문제
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 = "-";
제휴하지 않습니다 StackOverflow