public IHttpActionResult PostProduct(Product product) { performAdditionalValidation(ModelState, product); if (!ModelState.IsValid) { return(BadRequest(ModelState)); } return(Ok(repository.save(product))); }
public IHttpActionResult PostAuthor(Author author) { performAdditionalValidation(ModelState, author); if (!ModelState.IsValid) { return(BadRequest(ModelState)); } return(Ok(authorRepository.save(author))); }