public void CreateOption(Guid productId, ProductOption option) { if (option == null) { var response = HttpResponseFactory.ConstructResponse(HttpStatusCode.BadRequest, "Option cannot be null."); throw new HttpResponseException(response); } try { _productsService.CreateOption(productId, option); } catch (Exception) { var response = HttpResponseFactory.ConstructResponse(HttpStatusCode.BadRequest, string.Format("Product with Id = {0} not found.", productId)); throw new HttpResponseException(response); } }