Пример #1
0
        public IActionResult GetOptions(Guid productId)
        {
            var options = _productOptionRepository.GetMultiple(s => s.ProductId == productId);

            if (options == null || !options.Any())
            {
                return(NotFound());
            }

            var mappedOptions = _mapper.Map <IEnumerable <ProductOption>, IEnumerable <ProductOptionViewModel> >(options).ToList();

            return(new ObjectResult(mappedOptions));
        }