public async Task <IActionResult> GetProductOptionsByProductId(Guid productId) { try { _logger.LogDebug($"Received {nameof(GetProductOptionsByProductId)} request with Product Id {productId}"); var productOptions = await _service.GetAllOptionsByProductIdAsync(productId); _logger.LogDebug($"Returned {nameof(GetProductOptionsByProductId)} response with " + $"product options {{@ProductOptions}}", productOptions); return(Ok(_mapper.Map <IEnumerable <ProductOptionResponseDto> >(productOptions))); } catch (ProductOptionNotFoundException exception) { _logger.LogError(exception, exception.Message); return(NotFound(exception.Message)); } }