public static DocumentStore GetDocumentStore(RavenDbConfiguration config)
{
var store = new DocumentStore()
{
Url = config.RavenDbUrl,
DefaultDatabase = config.RavenDbDatabase
};
store.Conventions.FindTypeTagName = type => type.IsSubclassOf(typeof(Sheet)) ? DocumentConvention.DefaultTypeTagName(typeof(Sheet)) : DocumentConvention.DefaultTypeTagName(type);
store.Conventions.RegisterIdConvention<IDocument>((dbname, commands, document) => document.GetId());
store.Conventions.RegisterAsyncIdConvention<IDocument>((dbname, commands, document) => new CompletedTask<string>(document.GetId()));
store.Initialize();
//Indexes
new AttachmentItemsByOriginalDocumentSourceAndOriginalId().Execute(store);
new SheetForSearch().Execute(store);
return store;
}
Hibernating Rhinos Ltd
Oren Eini l CEO l Mobile: + 972-52-548-6969
Office: +972-4-622-7811 l Fax: +972-153-4-622-7811
--
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
var store = new DocumentStore()
{
ConnectionStringName = connectionStringName
};
store.Conventions.FindTypeTagName = type => type.IsSubclassOf(typeof(Sheet)) ? DocumentConvention.DefaultTypeTagName(typeof(Sheet)) : DocumentConvention.DefaultTypeTagName(type);
store.Conventions.RegisterIdConvention<IDocument>((dbname, commands, document) => document.GetId());
store.Conventions.RegisterAsyncIdConvention<IDocument>((dbname, commands, document) => new CompletedTask<string>(document.GetId()));
store.Conventions.MaxNumberOfRequestsPerSession = 100;
store.Initialize();
new SheetId().Execute(store);
new SheetPin().Execute(store);
new AgentToSend().Execute(store);
new AttachmentItemsByOriginalDocumentSourceAndOriginalId().Execute(store);
new PoiByDescAndCoordinates().Execute(store);
new SheetByLottoIdAndSource().Execute(store);
new SheetForSearch().Execute(store);
new SheetsByIdInserzioneAndSourceId().Execute(store);
new PoiByDescAndCoordinates().Execute(store);
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Piazza Risorgimento, 1
20841 Carate Brianza (MB)
Tel. 0362 907601
Fax 039 3309896
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.