public IHttpActionResult Delete(Guid id, Guid optionId) { try { if (!_productOptionRepository.ProductOptionExists(optionId)) { return(NotFound()); } var productOption = _productOptionRepository.GetProductOptionForProduct(id, optionId); if (productOption == null) { return(NotFound()); } _productOptionRepository.DeleteProductOption(optionId, id); if (!_productOptionRepository.Save()) { return(InternalServerError()); } return(new ResponseMessageResult(new HttpResponseMessage(HttpStatusCode.NoContent))); } catch (Exception ex) { return(new ResponseMessageResult(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ex.Message))); } }
public void DeleteProductOption(Guid id) { _productOptionRepository.DeleteProductOption(id); }