Esempio n. 1
0
 public void DoPointOfContactUpdate(UpdatedPointOfContact updatedPointOfContact, Contact contactToUpdate,
                                    List <EmailAddress> emails, List <PhoneNumber> phones)
 {
     contactToUpdate.FullName       = updatedPointOfContact.FullName;
     contactToUpdate.Position       = updatedPointOfContact.Position;
     contactToUpdate.EmailAddresses = emails;
     contactToUpdate.PhoneNumbers   = phones;
     updatedPointOfContact.Audit.SetHistory(contactToUpdate);
 }
Esempio n. 2
0
        /// <summary>
        /// Updates a point of the contact in the datastore.
        /// </summary>
        /// <param name="updatedPointOfContact"></param>
        /// <returns></returns>
        public async Task <Contact> UpdateContactAsync(UpdatedPointOfContact updatedPointOfContact)
        {
            var contactToUpdate = await Context.Contacts.FindAsync(updatedPointOfContact.Id);

            var emails = await Context.EmailAddresses.Where(x => x.ContactId == updatedPointOfContact.Id).ToListAsync();

            var phones = await Context.PhoneNumbers.Where(x => x.ContactId == updatedPointOfContact.Id).ToListAsync();

            DoPointOfContactUpdate(updatedPointOfContact, contactToUpdate, emails, phones);

            return(contactToUpdate);
        }
Esempio n. 3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="pointOfContact"></param>
 /// <returns></returns>
 public Task <Contact> UpdateContactAsync(UpdatedPointOfContact updatedPointOfContact)
 {
     Contract.Requires(updatedPointOfContact != null, "The point of contact must not be null.");
     return(Task.FromResult <Contact>(null));
 }