/// <summary> /// Get All. /// </summary> public async Task <IEnumerable <ShelveDTO> > GetAllShelves(ShelvesFilters filters) { var applyFilter = _builderFilter.Empty; if (filters.FilterByBookId != null) { applyFilter = _builderFilter.Where(shelve => shelve.BookIds.Any(b => b == filters.FilterByBookId)); } var result = await _context.ShelveCollection.Find(applyFilter).ToListAsync(); return(_mapper.Map <IEnumerable <ShelveDTO> >(result)); }
/// <summary> /// Get All. /// </summary> public async Task <IEnumerable <ShelveDTO> > GetShelves(ShelvesFilters filters) { return(await _shelvesRepository.GetAllShelves(filters)); }