Created
July 3, 2014 04:42
-
-
Save ksummerlin/5031e8ed334303e4bcee to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[AcceptVerbs("PATCH")] | |
public HttpResponseMessage PatchOrder(int id, Delta<Order> deltaOrder) | |
{ | |
using (DBOrderEntities objContext = new DBOrderEntities()) { | |
var order = objContext.Orders.SingleOrDefault(o => o.ID == id); | |
if (order == null) | |
{ | |
throw new HttpResponseException(HttpStatusCode.NotFound); | |
} | |
deltaOrder.Patch(order); | |
objContext.SaveChanges(); | |
} | |
return Request.CreateResponse(HttpStatusCode.NoContent); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment