private async Task <List <SelectListItem> > GetCategorySelectListItems(SelectListItem prependOption) { List <tlkpCategory> categories = await _pokedexRepository.GetAllCategories(); return(categories.Select(p => new SelectListItem { Text = p.Name, Value = p.Id.ToString() }).Prepend(prependOption).ToList()); }
public async Task <List <GenericLookupResult> > GetAllCategories() { List <tlkpCategory> categories = await _pokedexRepository.GetAllCategories(); _logger.LogInformation(string.Format(Constants.InformationalMessageMappingWithCount, categories.Count, Constants.Category, Results)); return(categories.Select(a => new GenericLookupResult { Id = a.Id, Name = a.Name }).ToList()); }