public IHttpActionResult UpdateOption(Guid productId, Guid id, ProductOption option)
        {
            var logger = Log.ForContext("productId", productId).ForContext("id", id).ForContext("ProductOption", option);

            logger.Verbose(nameof(UpdateOption));
            if (Product.Load(productId) == null)
            {
                return(NotFound());
            }
            var orig = ProductOption.Load(id);

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

            if (orig.Update(option))
            {
                return(Ok(orig));
            }
            else
            {
                logger.Error($"Error in Creation something wrong with the number of elements saved {nameof(UpdateOption)}");
                return(FailedToSave());
            }
        }
        public IHttpActionResult DeleteOption(Guid productId, Guid id)
        {
            var logger = Log.ForContext("id", id);

            logger.Verbose(nameof(DeleteOption));
            if (Product.Load(productId) == null)
            {
                return(NotFound());
            }
            var itemToBeDeleted = ProductOption.Load(id);

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

            if (itemToBeDeleted.Delete())
            {
                return(Ok(itemToBeDeleted));
            }
            else
            {
                logger.Error($"Error in Creation something wrong with the number of elements saved {nameof(DeleteOption)}");
                return(FailedToSave());
            }
        }
        public IHttpActionResult GetOption(Guid productId, Guid id)
        {
            var logger = Log.ForContext("productId", productId).ForContext("id", id);

            logger.Verbose(nameof(GetOption));
            if (Product.Load(productId) == null)
            {
                return(NotFound());
            }
            var option = ProductOption.Load(id);

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