コード例 #1
0
        public IActionResult GetAllContactDetail()
        {
            try
            {
                var contactDetails = _contactInformationRepository.GetAllContactDetails();

                return(Ok(contactDetails.Select(item => new ContactDetailDTO()
                {
                    ContactDetailId = item.ContactDetailId,
                    FirstName = item.FirstName,
                    LastName = item.LastName,
                    Email = item.Email,
                    PhoneNumber = item.PhoneNumber,
                    Status = item.Status.ToString()
                })));
            }
            catch (Exception ex)
            {
                return(BadRequest(new { Message = ex.Message }));
            }
        }