예제 #1
0
 public Task <List <T> > ToListAsync()
 {
     return(Task.Factory.StartNew(() => {
         using (((SQLiteConnectionWithLock)_innerQuery.Connection).Lock()) {
             return _innerQuery.ToList();
         }
     }));
 }
예제 #2
0
 public Task <List <T> > ToListAsync(
     CancellationToken cancellationToken = default(CancellationToken))
 {
     return(Task.Factory.StartNew(
                () =>
     {
         cancellationToken.ThrowIfCancellationRequested();
         using (_db.Lock())
             return _innerQuery.ToList();
     }, cancellationToken, _taskCreationOptions,
                _taskScheduler ?? TaskScheduler.Default));
 }
예제 #3
0
        /// <summary>
        ///		Executes the current <paramref name="query"/>
        ///		and enumerates it to a list.
        /// </summary>
        /// <remarks>
        ///		Warning. This method could cause serious performance
        ///		implications and should only be used for limited sets of data.
        /// </remarks>
        public static ICollection <T> WithChildren <T>(this ITableQuery <T> query, params string[] relationshipPropertyNames) where T : new()
        {
            List <T> results = query.ToList();

            // ReSharper disable once CompareNonConstrainedGenericWithNull
            if (results.Count == 0)
            {
                return(results);
            }

            query.Connection.SetChildren(results);

            return(results);
        }