Skip to content

Commit 2ae8ad2

Browse files
Changes FindManyAsync, now the parameter is IEnumberable.
Adds FindManyAsync to the README. Adds FindManyAsync documentation.
1 parent 65acd80 commit 2ae8ad2

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ await rebels.CreateOrUpdateAsync(rebel);
205205
await rebels.DeleteAsync(rebel);
206206
var rebel = await rebels.FindAsync(id);
207207
var rebel = await rebels.FindAsync(id, withConflicts: true);
208+
var rebels = await rebels.FindManyAsync(ids);
208209
// Bulk
209210
await rebels.CreateOrUpdateRangeAsync(moreRebels);
210211
// Utils

src/CouchDB.Driver/CouchDatabase.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,12 @@ public async Task<TSource> FindAsync(string docId, bool withConflicts = false)
236236
}
237237
}
238238

239-
public async Task<List<TSource>> FindManyAsync(string[] docIds)
239+
/// <summary>
240+
/// Finds all documents with given IDs.
241+
/// </summary>
242+
/// <param name="docIds">The collection of documents IDs.</param>
243+
/// <returns></returns>
244+
public async Task<List<TSource>> FindManyAsync(IEnumerable<string> docIds)
240245
{
241246
var bulkGetResult = await NewRequest()
242247
.AppendPathSegment("_bulk_get")

src/CouchDB.Driver/Helpers/MicrosecondEpochConverter.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ namespace CouchDB.Driver.Helpers
88
internal class MicrosecondEpochConverter : DateTimeConverterBase
99
#pragma warning restore CA1812 // Avoid uninstantiated internal classes
1010
{
11-
private static readonly DateTime Epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
11+
private static readonly DateTime _epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
1212

1313
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
1414
{
15-
writer.WriteRawValue(((DateTime)value - Epoch).TotalMilliseconds + "000");
15+
writer.WriteRawValue(((DateTime)value - _epoch).TotalMilliseconds + "000");
1616
}
1717

1818
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
1919
{
2020
if (reader.Value == null) { return null; }
21-
return Epoch.AddMilliseconds((long)reader.Value / 1000d);
21+
return _epoch.AddMilliseconds((long)reader.Value / 1000d);
2222
}
2323
}
2424
}

0 commit comments

Comments
 (0)