Пример #1
0
        public IEnumerable <ContactResponseDTO> FindAll()
        {
            IEnumerable <ContactsEntity> contacts = _contactsRepo.FindAll();

            if (contacts.Count() == 0)
            {
                return(null);
            }

            List <ContactResponseDTO> contactResponse = new List <ContactResponseDTO>();

            foreach (ContactsEntity contact in contacts)
            {
                ContactResponseDTO contactResponseDTO = _contactsMapper.convertEntityToDTO(contact);
                contactResponse.Add(contactResponseDTO);
            }

            return(contactResponse);
        }