Example #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);
        }
Example #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();
            }
        }