Quantcast
Channel: URF - Unit of Work & (extensible/generic) Repositories Framework
Viewing all articles
Browse latest Browse all 1539

New Post: The source IQueryable doesn't implement IDbAsyncEnumerable

$
0
0
public async static Task<List<Book>> FindByTextAsync(this IRepositoryAsync<Book> repository, string text)
        {
            return await repository.FindByTextInternal(text).ToListAsync();
        }
        
        public static List<Book> FindByText(this IRepositoryAsync<Book> repository, string text) 
        {
            return repository.FindByTextInternal(text).ToList();
        }

        private static IQueryable<Book> FindByTextInternal(this IRepositoryAsync<Book> repository, string text)
        {
            IQueryObject<Book> query = new BookQuery()
                .OrElseTitleContains(text)
                .OrElseEditorContains(text)
                .OrElseLanguageContains(text)
                .OrElseMaterialContains(text);          

            return repository.Query(query).Select().AsQueryable();
        }
When I call:
var books = await _unitOfWork.RepositoryAsync<Book>().FindByTextAsync(keyWord);
I get:

The source IQueryable doesn't implement IDbAsyncEnumerable<LibraryEntityDataModel.Book>. Only sources that implement IDbAsyncEnumerable can be used for Entity Framework asynchronous operations. For more details see http://go.microsoft.com/fwlink/?LinkId=287068._

Is there any way to make it work as expected?

Viewing all articles
Browse latest Browse all 1539

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>