public IEnumerable <SelectListItemVo> GetByUser(Guid userId) { IEnumerable <Game> allModels = gameDomainService.GetByUserId(userId); List <SelectListItemVo> vms = mapper.Map <IEnumerable <Game>, IEnumerable <SelectListItemVo> >(allModels).ToList(); return(vms); }
public OperationResultVo GetMyUntranslatedGames(Guid currentUserId) { try { IEnumerable <Game> myGames = gameDomainService.GetByUserId(currentUserId); IEnumerable <Guid> myTranslatedGames = translationDomainService.GetTranslatedGamesByUserId(currentUserId); IEnumerable <Game> availableGames = myGames.Where(x => !myTranslatedGames.Contains(x.Id)); List <SelectListItemVo> vms = mapper.Map <IEnumerable <Game>, IEnumerable <SelectListItemVo> >(availableGames).ToList(); return(new OperationResultListVo <SelectListItemVo>(vms)); } catch (Exception ex) { return(new OperationResultVo(ex.Message)); } }