Exemple #1
0
 public void RemoveContact(ContactDetailViewModel contactToRemove)
 {
     if (contactToRemove.GetPersonDto()?.GoogleId != null)
     {
         contactsProvider.RemoveContact(contactToRemove.GetPersonDto());
     }
     else
     {
         Log.Warn("Contact could not be removed, because it is not saved!");
     }
 }
Exemple #2
0
        public ContactDetailViewModel SaveContact(ContactDetailViewModel addContactViewModel)
        {
            var dto   = addContactViewModel.GetPersonDto();
            var saved = dto?.GoogleId == null
                ? contactsProvider.AddContact(addContactViewModel.ToPersonDto()).Let(x => new ContactDetailViewModel(x))
                : contactsProvider.UpdateContact(dto).Let(x => new ContactDetailViewModel(x));

            return(saved);
        }