コード例 #1
0
        /// <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);
        }
コード例 #2
0
 /// <summary>
 /// Returns first document of resultset or null if resultset are empty
 /// </summary>
 public Task <T> FirstOrDefaultAsync()
 {
     return(_liteDatabaseAsync.EnqueueAsync(
                () => _wrappedQuery.FirstOrDefault()));
 }