Exemple #1
0
        public JsonResult GetByNickname(string nickname)
        {
            var gamer          = _gamerService.GetGamerBoardGameByNickname(nickname);
            var gamerViewModel = Mapper.Map <GamerViewModel>(gamer);

            return(Json(gamerViewModel, JsonRequestBehavior.AllowGet));
        }
        private IEnumerable <GamerBoardGameViewModel> GetGamerAvailableBoardGameList(string nickname)
        {
            var gamer = _gamerService.GetGamerBoardGameByNickname(nickname);
            var gamerAvailableBoardGameList = _gamerBoardGameService.GetGamerAvailableBoardGameList(nickname);

            var availableBoardGameListViewModel =
                Mapper.Map <List <GamerBoardGameViewModel> >(gamerAvailableBoardGameList);

            foreach (var obj in availableBoardGameListViewModel)
            {
                Mapper.Map(gamer, obj);
            }

            return(availableBoardGameListViewModel);
        }