Пример #1
0
        public async Task <IActionResult> Index(string searchTerm)
        {
            SearchViewModel viewModel = new SearchViewModel();

            if (string.IsNullOrEmpty(searchTerm))
            {
                return(View(viewModel));
            }

            viewModel.SearchTerm = searchTerm;

            viewModel.Artists = await _artistsService
                                .SearchArtistsAsync(searchTerm);

            viewModel.Lyrics = await _lyricsService
                               .SearchLyricsAsync(searchTerm);

            return(View(viewModel));
        }