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); }
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); }
protected virtual ILowLevelBulkInsertOperation GetBulkInsertOperation(BulkInsertOptions options, IAsyncDatabaseCommands commands, IDatabaseChanges changes) { return commands.GetBulkInsertOperation(options, changes); }
protected virtual ILowLevelBulkInsertOperation GetBulkInsertOperation(BulkInsertOptions options, IAsyncDatabaseCommands commands, IDatabaseChanges changes) { return(commands.GetBulkInsertOperation(options, changes)); }
protected virtual TcpBulkInsertOperation GetBulkInsertOperation(IAsyncDatabaseCommands commands) { return(commands.GetBulkInsertOperation()); }