Esempio n. 1
0
		public BulkInsertOperation(string database, IDocumentStore documentStore, DocumentSessionListeners listeners, BulkInsertOptions options, IDatabaseChanges changes)
		{
			this.documentStore = documentStore;

			database = database ?? MultiDatabase.GetDatabaseName(documentStore.Url);

			// Fitzchak: Should not be ever null because of the above code, please refactor this.
			DatabaseCommands = database == null
				? documentStore.AsyncDatabaseCommands.ForSystemDatabase()
				: documentStore.AsyncDatabaseCommands.ForDatabase(database);

			generateEntityIdOnTheClient = new GenerateEntityIdOnTheClient(documentStore, entity => documentStore.Conventions.GenerateDocumentKeyAsync(database, DatabaseCommands, entity).ResultUnwrap());
			operation = DatabaseCommands.GetBulkInsertOperation(options, changes);
			entityToJson = new EntityToJson(documentStore, listeners);
		}
Esempio n. 2
0
        public BulkInsertOperation(string database, IDocumentStore documentStore, DocumentSessionListeners listeners, BulkInsertOptions options, IDatabaseChanges changes)
        {
            this.documentStore = documentStore;

            database = database ?? MultiDatabase.GetDatabaseName(documentStore.Url);

#if !SILVERLIGHT
            // Fitzchak: Should not be ever null because of the above code, please refactor this.
            DatabaseCommands = database == null
                                                                   ? documentStore.DatabaseCommands.ForSystemDatabase()
                                                                   : documentStore.DatabaseCommands.ForDatabase(database);

            generateEntityIdOnTheClient = new GenerateEntityIdOnTheClient(documentStore, entity => documentStore.Conventions.GenerateDocumentKey(database, DatabaseCommands, entity));
#else
            DatabaseCommands = database == null
                                                                   ? documentStore.AsyncDatabaseCommands.ForSystemDatabase()
                                                                   : documentStore.AsyncDatabaseCommands.ForDatabase(database);

            generateEntityIdOnTheClient = new GenerateEntityIdOnTheClient(documentStore, entity => documentStore.Conventions.GenerateDocumentKeyAsync(database, DatabaseCommands, entity).Result);
#endif
            operation    = DatabaseCommands.GetBulkInsertOperation(options, changes);
            entityToJson = new EntityToJson(documentStore, listeners);
        }
Esempio n. 3
0
 protected virtual ILowLevelBulkInsertOperation GetBulkInsertOperation(BulkInsertOptions options, IAsyncDatabaseCommands commands, IDatabaseChanges changes)
 {
     return commands.GetBulkInsertOperation(options, changes);
 }
Esempio n. 4
0
 protected virtual ILowLevelBulkInsertOperation GetBulkInsertOperation(BulkInsertOptions options, IAsyncDatabaseCommands commands, IDatabaseChanges changes)
 {
     return(commands.GetBulkInsertOperation(options, changes));
 }
Esempio n. 5
0
 protected virtual TcpBulkInsertOperation GetBulkInsertOperation(IAsyncDatabaseCommands commands)
 {
     return(commands.GetBulkInsertOperation());
 }