You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.0 KiB
37 lines
1.0 KiB
using DataBase.Entity;
|
|
using DTO;
|
|
|
|
namespace ApiLeapHit.Mapper
|
|
{
|
|
public static class GameMapper
|
|
{
|
|
public static DTOGame ToDto(this Game game)
|
|
{
|
|
DTOGame dtoGame = new DTOGame()
|
|
{
|
|
gameId = game.gameId,
|
|
durationGame = game.durationGame,
|
|
nbMaxEchanges = game.nbMaxEchanges,
|
|
playerWinner = game.winner,
|
|
playerLoser = game.loser,
|
|
scoreLoser = game.scoreLoser,
|
|
scoreWinner = game.scoreWinner
|
|
};
|
|
return dtoGame;
|
|
}
|
|
|
|
public static Game ToGame(this DTOGame dtoGame)
|
|
{
|
|
return new Game
|
|
{
|
|
durationGame = dtoGame.durationGame,
|
|
nbMaxEchanges = dtoGame.nbMaxEchanges,
|
|
winner = dtoGame.playerWinner,
|
|
loser = dtoGame.playerLoser,
|
|
scoreLoser = dtoGame.scoreLoser,
|
|
scoreWinner = dtoGame.scoreWinner
|
|
};
|
|
}
|
|
}
|
|
}
|