Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        public IActionResult GetActive(GetActiveProductInput input)
        {
            var dto = _service.GetAllActive(input);

            if (dto == null)
            {
                return(NotFound());
            }
            return(Ok(dto));
        }