public IHttpActionResult Put([FromBody] RoastType roastType) { IHttpActionResult result; if (roastType != null) { repository.Insert(roastType); result = StatusCode(HttpStatusCode.Created); } else { result = StatusCode(HttpStatusCode.BadRequest); } return(result); }
public IHttpActionResult Post([FromBody] RoastType roastType) { IHttpActionResult result; if (roastType != null) { repository.Update(roastType); result = Ok(); } else { result = NotFound(); } return(result); }
public IHttpActionResult Get(int id) { IHttpActionResult result; RoastType roastType = repository.GetByID((int)id); if (roastType != null) { result = Json <RoastType>(roastType); } else { result = NotFound(); } return(result); }