/// <summary> /// Returns first document of resultset or null if resultset are empty /// </summary> public Task <T> FirstOrDefaultAsync() { var tcs = new TaskCompletionSource <T>(); _liteDatabaseAsync.Enqueue(tcs, () => { tcs.SetResult(_wrappedQuery.FirstOrDefault()); }); return(tcs.Task); }
/// <summary> /// Returns first document of resultset or null if resultset are empty /// </summary> public Task <T> FirstOrDefaultAsync() { return(_liteDatabaseAsync.EnqueueAsync( () => _wrappedQuery.FirstOrDefault())); }