// GET api/contactlist/xxx
 public Models.ContactList Get(string id)
 {
     try
     {
         using (var repo = new Data.ContactsRepository())
         {
             return repo.GetContactList(id);
         }
     }
     catch (Exception ex)
     {
         Logger.DebugException("Get failed", ex);
         throw;
     }
 }
Ejemplo n.º 2
0
 public void AddContact(AddContactRequest request)
 {
     try
     {
         using (var repo = new Data.ContactsRepository())
         {
             var clist = repo.GetContactList(request.contactlist);
             if (!clist.ContactIds.Contains(request.contact))
             {
                 clist.ContactIds.Add(request.contact);
             }
             repo.UpdateContactList(clist);
         }
     }
     catch (Exception ex)
     {
         Logger.DebugException("AddContact failed", ex);
         throw;
     }
 }