Esempio n. 1
0
        public void UpdatePersonContact(int id, PersonContactType personContactType, string value)
        {
            var contact = PersonContacts
                          .FirstOrDefault(
                x => x.Id == id && !x.IsDeleted);

            if (contact == null)
            {
                throw new NotFoundException(
                          StringResource.Contact,
                          StringResource.Id,
                          id);
            }

            contact.Update(personContactType, value);
        }
Esempio n. 2
0
        public void DeletePersonContact(int id)
        {
            var contact = PersonContacts
                          .FirstOrDefault(
                x => x.Id == id && !x.IsDeleted);

            if (contact == null)
            {
                throw new NotFoundException(
                          StringResource.Contact,
                          StringResource.Id,
                          id);
            }
            else
            {
                contact.Delete();
            }
        }