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 }; }*/ } }