Skip to content

Commit fc71c6d

Browse files
Fix bulk delete
1 parent b5cdd62 commit fc71c6d

File tree

4 files changed

+3
-6
lines changed

4 files changed

+3
-6
lines changed

src/CouchDB.Driver/CouchDatabase.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ await UpdateAttachments(document, cancellationToken)
322322
/// <inheritdoc />
323323
public Task DeleteRangeAsync(IEnumerable<TSource> documents, CancellationToken cancellationToken = default)
324324
{
325-
DocumentId[] docIds = documents.Cast<DocumentId>().ToArray();
325+
DocumentId[] docIds = documents.Select(doc => (DocumentId)doc).ToArray();
326326
return DeleteRangeAsync(docIds, cancellationToken);
327327
}
328328

src/CouchDB.Driver/Types/DocumentId.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public DocumentId(CouchDocument document)
1919
public string Id { get; }
2020
public string Rev { get; }
2121

22-
public static implicit operator DocumentId(CouchDocument documentId)
22+
public static explicit operator DocumentId(CouchDocument documentId)
2323
{
2424
return new DocumentId(documentId.Id, documentId.Rev);
2525
}

src/azure-pipelines.yaml

-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ trigger:
1414
- azure-pipelines.yml
1515

1616
pr:
17-
branches:
18-
include:
19-
- master
2017
paths:
2118
exclude:
2219
- README.md

tests/CouchDB.Driver.UnitTests/Database_Tests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ public async Task DeleteRange()
374374
var moreRebels = new[] {
375375
new Rebel { Name = "Luke", Id = "1" },
376376
new Rebel { Name = "Leia", Id = "2" }
377-
}.Cast<DocumentId>().ToArray();
377+
}.Select(doc => (DocumentId)doc).ToArray();
378378
await _rebels.DeleteRangeAsync(moreRebels);
379379
httpTest
380380
.ShouldHaveCalled("http://localhost/rebels/_bulk_docs")

0 commit comments

Comments
 (0)