Exemplo n.º 1
0
 public HttpResponseMessage Put(Guid id, Trip trip)
 {
     if (_dbContext.Trips.SingleOrDefault(x => x.Id == id) == null)
     {
         throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.NotFound));
     }
     _dbContext.Trips.AddOrUpdate(trip);
     _dbContext.SaveChanges();
     return(new HttpResponseMessage(HttpStatusCode.NoContent));
 }