예제 #1
0
        // 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;
        }
예제 #2
0
 // Update
 public HttpResponseMessage Put(Pupil pupil)
 {
     Uow.Pupils.Update(pupil);
     Uow.Commit();
     return new HttpResponseMessage(HttpStatusCode.NoContent);
 }