public Person Put(int? id, Person personToUpdate) { if (!id.HasValue) { throw new HttpResponseException(HttpStatusCode.BadRequest, "No person ID provided"); } personToUpdate.Values = new[] { String.Format("Person #{0} updated", id) }; return personToUpdate; }
public Person Patch(int? id, Person resource) { if (!id.HasValue) { throw new HttpResponseException(HttpStatusCode.BadRequest, "No person ID provided"); } resource.Values = new[] { String.Format("Person #{0} partially updated", id) }; return resource; }
public object Post(Person resource) { resource.Values = new[] { "New person added" }; resource.TimeStamp = DateTime.Now; Context.Response.SetHeader("Location", Context.Request.Url.ToAbsoluteUrl("~/home/index/999")); return Result.ObjectWithResponseStatus(resource, HttpStatusCode.Created, "Person #999 created"); }