예제 #1
0
 public HttpResponseMessage<Contact> Post(Contact contact)
 {
     this.repository.Post(contact);
     var response = new HttpResponseMessage<Contact>(contact);
     response.StatusCode = HttpStatusCode.Created;
     return response;
 }
예제 #2
0
 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;
 }
예제 #3
0
 public void Post(Contact contact)
 {
     contact.ContactId = nextContactID++;
     contacts.Add(contact);
 }
예제 #4
0
 public Contact Put(int id, Contact contact)
 {
     this.repository.Get(id);
     this.repository.Update(contact);
     return contact;
 }