Ejemplo n.º 1
0
        public HttpResponseMessage Post(Bin value)
        {
            this.UnitOfWork.Bins.Add(value);
            this.UnitOfWork.Commit();

            var response = Request.CreateResponse(HttpStatusCode.Created, value);
            response.Headers.Location = new Uri(Url.Link(WebApiConfig.ControllerAndId, new { id = value.Id }));

            return response;
        }
Ejemplo n.º 2
0
 public HttpResponseMessage Put(Bin value)
 {
     this.UnitOfWork.Bins.Update(value);
     this.UnitOfWork.Commit();
     return new HttpResponseMessage(HttpStatusCode.NoContent);
 }