Esempio n. 1
0
        public ViewResult Create()
        {
            var platforms  = _platformService.GetAllPlatform().Select(a => a.Name).ToList();
            var genres     = _genreService.GetAllGenres().Select(a => a.Name).ToList();
            var publishers = _publisherService.GetAllPublisherCompanyNames().ToList();

            var gameCreate = new GameViewModel
            {
                GamePlatforms = platforms,
                GameGenres    = genres,
                Publishers    = publishers
            };

            return(View(gameCreate));
        }
Esempio n. 2
0
        public IActionResult GetAll()
        {
            var platforms     = _platformService.GetAllPlatform();
            var platformsView = _mapper.Map <IEnumerable <PlatformTypeViewModel> >(platforms);

            if (!platforms.Any())
            {
                return(StatusCode(StatusCodes.Status404NotFound));
            }

            return(Ok(platformsView));
        }