public Task <T> ElementAtAsync(int index) { return(Task.Factory.StartNew(() => { using (((SQLiteConnectionWithLock)_innerQuery.Connection).Lock()) { return _innerQuery.ElementAt(index); } })); }
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)); }