public async Task <ServiceResponse <SearchPhoneBookResponse> > Search(SearchPhoneBookRequest searchPhoneBook, Guid userId) { var searchResults = await _phoneBookRepository.GetAsync(searchPhoneBook.Name, userId); var entries = searchResults.Select(entry => entry.MapGeneric <PhoneBookEntry, EntryEntity>()).ToList(); return(new ServiceResponse <SearchPhoneBookResponse>("Successfully received search results") { Data = new SearchPhoneBookResponse { PhoneBookEntries = entries } }); }