示例#1
0
        public ITableQueryAsync <T> OrderBy <TValue>(Expression <Func <T, TValue> > orderExpr)
        {
            if (orderExpr == null)
            {
                throw new ArgumentNullException("orderExpr");
            }

            return(new TableQueryAsync <T>(
                       _innerQuery.OrderBy(orderExpr), _db, _taskScheduler ?? TaskScheduler.Default,
                       _taskCreationOptions));
        }
示例#2
0
        private async Task DoOrderByMultiField()
        {
            var enumerable = connection.RunAsync(testTable
                                                 .OrderBy(o => o.Name)
                                                 .ThenBy(o => o.Name)
                                                 .ThenByDescending(o => o.Name)
                                                 );

            Assert.That(enumerable, Is.Not.Null);
            var count = 0;

            while (true)
            {
                if (!await enumerable.MoveNext())
                {
                    break;
                }
                ++count;
                Assert.That(enumerable.Current.Name, Is.EqualTo(count.ToString()));
            }
            Assert.That(count, Is.EqualTo(7));
        }
示例#3
0
 public IAsyncTableQuery <T> OrderBy <U>(Expression <Func <T, U> > orderExpr)
 {
     return(new AsyncTableQuery <T>(_innerQuery.OrderBy <U>(orderExpr)));
 }