예제 #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));
 }