Пример #1
0
        /// <summary>
        /// Reads single contact.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task <(ContactInfo Data, DataStatus Status)> DataReadContactAsync(int id)
        {
            var(contact, status) = await ReadContactAsync(id);

            if (status.IsGood)
            {
                Data.UpdateContacts(contact);
            }
            else
            {
                _logger?.LogError($"Error code {status.Code} in reading contact: {status.Explanation}.");
            }

            Data.Status = status;
            return(contact, Data.Status);
        }