public ActionResult <IEnumerable <PlatformReadDto> > GetAllPlatforms() { try { var platforms = _repository.GetAllPlatforms(); return(Ok(_mapper.Map <IEnumerable <PlatformReadDto> >(platforms))); } catch (System.Exception) { return(NotFound()); } }
public ActionResult <IEnumerable <PlatformReadDto> > GetPlatforms() { Console.WriteLine("--> Getting platforms from CommandsService"); var platforms = _repo.GetAllPlatforms(); if (!platforms.Any()) { return(NotFound()); } var platformsReadDto = _mapper.Map <List <PlatformReadDto> >(platforms); return(Ok(platformsReadDto)); }