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.

40 lines
1018 B

using API.Dto;
using Model;
namespace API.Mapping
{
public static class ChampionMapper
{
public static ChampionDto ToDto(this Champion champion)
{
if(champion == null)
{
throw new ArgumentNullException("champion null");
}
return new ChampionDto
{
//Id = champion.Id,
Name = champion.Name, // je peux décider de mettre le nom en minuscule pour que le json est des noms en minuscule
Bio = champion.Bio,
};
}
/*public static Champion ToChampion(this ChampionDto championDto)
{
if (championDto == null)
{
throw new ArgumentNullException("Dto null");
}
return new Champion
{
Id = championDto.Id,
Name = championDto.Name,
Bio = championDto.Bio,
Icon = null
};
}*/
}
}