public IActionResult GetDrawers([FromQuery] DrawerQueryFilter filters) { var drawers = _drawerService.GetDrawers(filters); var drawersDtos = _mapper.Map <IEnumerable <DrawerDto> >(drawers); return(Ok(drawersDtos)); }
public IEnumerable <DrawerDto> GetDrawers(DrawerQueryFilter filters) { filters.PageNumber = filters.PageNumber == 0 ? _paginationOptions.DefaultPageNumber : filters.PageNumber; filters.PageSize = filters.PageSize == 0 ? _paginationOptions.DefaultPageSize : filters.PageSize; var drawers = _unitOfWork.DrawerRepository.GetAllDrawers(filters.BookSheflId, filters.RowStart, filters.RowEnd, filters.ColStart, filters.ColEnd); Debug.WriteLine(filters.RowStart.ToString() + "sdasdasdasd"); if (filters.BookGroupId != null) { var books = _unitOfWork.BookRepository.GetBookByBookGroup(filters.BookGroupId); drawers = _unitOfWork.DrawerRepository.GetDrawerByListBook(books); } if (filters.BookSheflId != null && filters.RowStart.ToString() == "0") { drawers = _unitOfWork.DrawerRepository.GetDrawerByBookShelfId(filters.BookSheflId); } return(drawers); }
public Uri GetDrawerPaginationUri(DrawerQueryFilter filter, string actionUrl) { string baseUrl = $"{_baseUri}{actionUrl}"; return(new Uri(baseUrl)); }