public HttpResponseMessage<Contact> Post(Contact contact) { this.repository.Post(contact); var response = new HttpResponseMessage<Contact>(contact); response.StatusCode = HttpStatusCode.Created; return response; }
public void Update(Contact updatedContact) { var contact = this.Get(updatedContact.ContactId); contact.Name = updatedContact.Name; contact.Address = updatedContact.Address; contact.City = updatedContact.City; contact.State = updatedContact.State; contact.Zip = updatedContact.Zip; contact.Email = updatedContact.Email; contact.Twitter = updatedContact.Twitter; }
public void Post(Contact contact) { contact.ContactId = nextContactID++; contacts.Add(contact); }
public Contact Put(int id, Contact contact) { this.repository.Get(id); this.repository.Update(contact); return contact; }