Пример #1
0
        public virtual async Task UpdateContactAsync(Contact contact)
        {
            await _customerApi.UpdateContactAsync(contact.ToContactDto());

            //Invalidate cache
            CustomerCacheRegion.ExpireMember(contact.Id);
        }
        public virtual async Task UpdateContactAsync(string contactId, ContactUpdateInfo contactUpdateInfo)
        {
            var existContact = await GetContactByIdAsync(contactId);

            if (existContact != null)
            {
                existContact.FirstName = contactUpdateInfo.FirstName;
                existContact.LastName  = contactUpdateInfo.LastName;
                existContact.Email     = contactUpdateInfo.Email;

                var contactDto = existContact.ToCustomerContactDto();
                await _customerApi.UpdateContactAsync(contactDto);

                //Invalidate cache
                CustomerCacheRegion.ExpireCustomer(existContact.Id);
            }
        }