// Create public HttpResponseMessage Post(Pupil pupil) { Uow.Pupils.Add(pupil); Uow.Commit(); var response = Request.CreateResponse(HttpStatusCode.Created, pupil); response.Headers.Location = new Uri(Url.Link(WebApiConfig.ControllerAndId, new { id = pupil.Id })); return response; }
// Update public HttpResponseMessage Put(Pupil pupil) { Uow.Pupils.Update(pupil); Uow.Commit(); return new HttpResponseMessage(HttpStatusCode.NoContent); }