// Create a new Session // POST /api/recipes public HttpResponseMessage Post(CookProcess cookProcess) { Uow.CookProcesses.Add(cookProcess); Uow.Commit(); var response = Request.CreateResponse(HttpStatusCode.Created, cookProcess); // Compose location header that tells how to get this session // e.g. ~/api/session/5 response.Headers.Location = new Uri(Url.Link(WebApiConfig.ControllerAndId, new { id = cookProcess.Id })); return response; }
// Update an existing Session // PUT /api/recipes/ public HttpResponseMessage Put(CookProcess cookProcess) { Uow.CookProcesses.Update(cookProcess); Uow.Commit(); return new HttpResponseMessage(HttpStatusCode.NoContent); }