コード例 #1
0
        public ActionResult <PlatformReadDto> GetPlatformById(int id)
        {
            var platformItem = _repository.GetPlatformById(id);

            if (platformItem != null)
            {
                return(Ok(_mapper.Map <PlatformReadDto>(platformItem)));
            }
            return(NotFound());
        }
コード例 #2
0
        public ActionResult <PlatformReadDto> GetPlatformById(int id)
        {
            var platform = _repo.GetPlatformById(id);

            if (platform is not null)
            {
                var platformReadDto = _mapper.Map <PlatformReadDto>(platform);
                return(Ok(platformReadDto));
            }

            return(NotFound());
        }