/// <summary> /// Returns the only document of resultset, or null if resultset are empty; this method throw an exception if there not exactly one document in the sequence /// </summary> public Task <T> SingleOrDefaultAsync() { var tcs = new TaskCompletionSource <T>(); _liteDatabaseAsync.Enqueue(tcs, () => { tcs.SetResult(_wrappedQuery.SingleOrDefault()); }); return(tcs.Task); }
/// <summary> /// Returns the only document of resultset, or null if resultset are empty; this method throw an exception if there not exactly one document in the sequence /// </summary> public Task <T> SingleOrDefaultAsync() { return(_liteDatabaseAsync.EnqueueAsync( () => _wrappedQuery.SingleOrDefault())); }