public Task <int> CountAsync() { return(Task.Factory.StartNew(() => { using (((SQLiteConnectionWithLock)_innerQuery.Connection).Lock()) { return _innerQuery.Count(); } })); }
public Task <int> CountAsync( CancellationToken cancellationToken = default(CancellationToken)) { return(Task.Factory.StartNew( () => { cancellationToken.ThrowIfCancellationRequested(); using (_db.Lock()) return _innerQuery.Count(); }, cancellationToken, _taskCreationOptions, _taskScheduler ?? TaskScheduler.Default)); }
private async Task DoCount() { var resp = await connection.RunAsync(testTable.Count()); Assert.That(resp, Is.EqualTo(7)); }
public void CountAggregate() { var count = connection.Run(testTable.Count(to => to.SomeNumber > 1)); Assert.That(count, Is.EqualTo(10)); }