Guest User

Untitled

a guest
Jan 16th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. public async Task CreateMultipleAsync(IEnumerable<JObject> models)
  2. {
  3. var collectionLink = UriFactory.CreateDocumentCollectionUri(_databaseName, _collectionName);
  4. var collection = await _client.ReadDocumentCollectionAsync(collectionLink);
  5. var bulkExecutor = new BulkExecutor(_client, collection);
  6.  
  7. try
  8. {
  9. await bulkExecutor.InitializeAsync();
  10. var response = await bulkExecutor.BulkImportAsync(models, true);
  11. } catch (Exception ex)
  12. {
  13.  
  14. }
  15. }
Add Comment
Please, Sign In to add comment