public async Task <IHttpActionResult> Get(int id) { // Prepare DTO GameResponseDTO responseDTO = await gameService.GetGame(id).ContinueWith( z => new GameResponseDTO() { GameId = z.Result.GameID, Title = z.Result.Title, Rating = z.Result.Rating, Developer = z.Result.Developer, Genre = z.Result.Genre, Description = z.Result.Description }); return(Ok(responseDTO)); }
internal GameResponseDTO MapGameEntityToGameResponseDTO(Game game) { var gameResponseDTO = new GameResponseDTO() { About = game.About, Description = game.Description, Id = game.Id, Developer = game.Developer, Name = game.Name, Price = game.Price, Publisher = game.Publisher, ReleaseDate = game.ReleaseDate, CustomerReviews = MapGameEntityCustomerReviews(game.CustomerReviews), Images = MapGameEntityImages(game.Images), SystemRequirements = MapGameEntitySystemRequirements(game.SystemRequirements) }; return(gameResponseDTO); }