コード例 #1
0
ファイル: RavenInstaller.cs プロジェクト: haefele/Mileage
 /// <summary>
 /// Customizes the raven database.
 /// </summary>
 /// <param name="documentStore">The document store.</param>
 private void CustomizeRavenDocumentStore(DocumentStore documentStore)
 {
     documentStore.Conventions.RegisterAsyncIdConvention <AuthenticationData>((databaseName, commands, entity) =>
     {
         return(Task.FromResult(AuthenticationData.CreateId(entity.UserId)));
     });
     documentStore.Conventions.RegisterAsyncIdConvention <AuthenticationToken>((databaseName, commands, entity) =>
     {
         return(Task.FromResult(AuthenticationToken.CreateId(entity.Token)));
     });
     documentStore.Conventions.RegisterAsyncIdConvention <MileageInternalSettings>((databaseName, commands, entity) =>
     {
         return(Task.FromResult(MileageInternalSettings.CreateId()));
     });
     documentStore.Conventions.RegisterAsyncIdConvention <MileageSettings>((databaseName, commands, entity) =>
     {
         return(Task.FromResult(MileageSettings.CreateId()));
     });
     documentStore.Conventions.RegisterAsyncIdConvention <StoredLayout>((databaseName, commands, entity) =>
     {
         return(Task.FromResult(StoredLayout.CreateId(entity.UserId, entity.LayoutName)));
     });
 }