public List <TypesOutDTO> GetTypes() { var types = _phoneBookRepository.GetTypes(); var result = types.Select(x => new TypesOutDTO { Id = x.Id, Name = x.Name, }).ToList(); return(result); }