private async Task <IEnumerable <ListItem> > CreatePlatformsAsync() { var platformsDto = await _platformServices.GetAllAsync(); var platforms = _mapper.Map <IEnumerable <ListItem> >(platformsDto); return(platforms); }
public async Task <IActionResult> GetAllAsync() { var platforms = await _platformServices.GetAllAsync(); var platformsViewModel = _mapper.Map <IEnumerable <PlatformViewModel> >(platforms); return(View("Index", platformsViewModel)); }
public async Task <ApiResponse> GetAll() { IEnumerable <Platform> result = await platformService.GetAllAsync(); if (result != null) { return(new ApiResponse(result, ResponseStatusCode.Success, "Successfully returned Platform list.")); } return(new ApiResponse(result, ResponseStatusCode.Error, "Could not return Platform list.")); }
private async Task <IEnumerable <ListItem> > SetupPlatformsAsync(IEnumerable <string> selectedPlatforms) { var platforms = await _platformService.GetAllAsync(); var listItems = _mapper.Map <IEnumerable <ListItem> >(platforms); foreach (var listItem in listItems) { listItem.Selected = IsCheckedListItem(selectedPlatforms, listItem); } return(listItems); }