public IHttpActionResult PutProduct(int id, Product product) { performAdditionalValidation(ModelState, product); if (!ModelState.IsValid) { return(BadRequest(ModelState)); } try { return(Ok(repository.update(product, id))); } catch (Exception e) { return(NotFound()); } }
public IHttpActionResult PutAuthor(int id, Author author) { performAdditionalValidation(ModelState, author); if (!ModelState.IsValid) { return(BadRequest(ModelState)); } try { return(Ok(authorRepository.update(author, id))); } catch (Exception e) { return(NotFound()); } }