public HttpResponseMessage Delete(int id) { var repo = new FakeContactDatabase(); repo.Delete(id); var response = Request.CreateResponse(HttpStatusCode.OK); return response; }
public HttpResponseMessage Put(Contact contact) { var repo = new FakeContactDatabase(); repo.Edit(contact); var response = Request.CreateResponse(HttpStatusCode.OK, contact); string uri = Url.Link("DefaultApi", new {id = contact.ContactID}); response.Headers.Location = new Uri(uri); return response; }
public Contact Get(int id) { var repo = new FakeContactDatabase(); return repo.GetById(id); }
public List<Contact> Get() { var repo = new FakeContactDatabase(); return repo.GetAll(); }