Пример #1
0
        // Create
        public HttpResponseMessage Post(Classroom room)
        {
            Uow.Rooms.Add(room);
            Uow.Commit();

            var response = Request.CreateResponse(HttpStatusCode.Created, room);

            response.Headers.Location = new Uri(Url.Link(WebApiConfig.ControllerAndId, new { id = room.Id }));

            return response;
        }
Пример #2
0
 // Update
 public HttpResponseMessage Put(Classroom room)
 {
     Uow.Rooms.Update(room);
     Uow.Commit();
     return new HttpResponseMessage(HttpStatusCode.NoContent);
 }