Пример #1
0
        public async Task Entities_LastAsync_Predicate()
        {
            //Arrange
            PopulateTestData(1, 0);

            var expected = await EntityFrameworkQueryableExtensions.LastAsync(_context.Blogs, b => b.BlogId > 0);

            //Act
            var result = await(_context.Blogs.AsQueryable() as IQueryable).LastAsync("it.BlogId > 0");

            //Assert
            Assert.Equal(expected, result);
        }
Пример #2
0
 public Task <TSource> LastAsync <TSource>(IQueryable <TSource> source, Expression <Func <TSource, bool> > predicate, CancellationToken cancellationToken = default(CancellationToken))
 {
     return(EntityFrameworkQueryableExtensions.LastAsync(source, predicate, cancellationToken));
 }
 public Task <TSource> LastAsync <TSource>(
     IQueryable <TSource> source,
     CancellationToken cancellationToken = default) =>
 EntityFrameworkQueryableExtensions.LastAsync(source, cancellationToken);