public IHttpActionResult Add([FromBody] Beer beer) { if (Beer.IsValid(beer) && beerRepository.Add(beer)) { return(Ok()); } else { return(Content(HttpStatusCode.BadRequest, "")); } }
public IHttpActionResult Update([FromBody] Beer beer) { if (Beer.IsValid(beer)) { Beer updatedBeer = beerRepository.Update(beer); if (updatedBeer != null) { return(Ok(updatedBeer)); } else { return(Content(HttpStatusCode.BadRequest, "")); } } else { return(Content(HttpStatusCode.BadRequest, "")); } }