示例#1
0
 public Task <T> ElementAtAsync(int index)
 {
     return(Task.Factory.StartNew(() => {
         using (((SQLiteConnectionWithLock)_innerQuery.Connection).Lock()) {
             return _innerQuery.ElementAt(index);
         }
     }));
 }
示例#2
0
 public Task <T> ElementAtAsync(
     int index, CancellationToken cancellationToken = default(CancellationToken))
 {
     return(Task.Factory.StartNew(
                () =>
     {
         cancellationToken.ThrowIfCancellationRequested();
         using (_db.Lock())
             return _innerQuery.ElementAt(index);
     }, cancellationToken, _taskCreationOptions,
                _taskScheduler ?? TaskScheduler.Default));
 }