Пример #1
0
        public async Task <IReadOnlyCollection <Course> > GetCoursesAsync()
        {
            var results = await _context.AsQueryable()
                          .ToListAsync();

            return(results.AsReadOnly());
        }
Пример #2
0
 /*
  *  this method let’s us to get whole non-materialized collection and
  *  perform some operations later
  *  (it’s slower than other methods because adds extra abstraction layer)
  */
 public IQueryable <T> AsQueryable()
 {
     return(_collection.AsQueryable());
 }