public IEnumerable <ProductDto> GetAllActive(GetActiveProductInput input) { var allActiveProducts = _productRepository.GetRange(input.SkipCount, input.MaxResultCount, product => product.IsAvailable); var result = Mapper.Map <IEnumerable <ProductDto> >(allActiveProducts); return(result); }
public IActionResult GetActive(GetActiveProductInput input) { var dto = _service.GetAllActive(input); if (dto == null) { return(NotFound()); } return(Ok(dto)); }