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