public Task <int> InsertOrReplaceAllAsync(IEnumerable items) { if (items == null) { throw new ArgumentNullException("items"); } return(Task.Factory.StartNew(() => { SQLiteConnectionWithLock conn = GetConnection(); using (conn.Lock()) { return conn.InsertOrReplaceAll(items); } }, CancellationToken.None, _taskCreationOptions, _taskScheduler ?? TaskScheduler.Default)); }