public IActionResult UpdateProduct(int productId, [FromBody] ProductForUpdateDTO product)
        {
            if (product == null)
            {
                return(BadRequest());
            }

            if (!_supermarketRepository.ProductExists(productId))
            {
                return(NotFound());
            }

            // Validate data
            if (!ModelState.IsValid)
            {
                // return 422
                return(new UnprocessableEntityObjectResult(ModelState));
            }

            var productFromRepo = _supermarketRepository.GetProductById(productId);

            if (productFromRepo == null)
            {
                return(NotFound());
            }

            Mapper.Map(product, productFromRepo);

            _supermarketRepository.UpdateProduct(productId);

            if (!_supermarketRepository.Save())
            {
                throw new Exception($"Updating product {productId} failed on saving.");
            }

            return(NoContent());
        }