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.
27 lines
713 B
27 lines
713 B
using DTO;
|
|
using Model;
|
|
|
|
namespace ApiLol.Mapper
|
|
{
|
|
public static class ChampionMapper
|
|
{
|
|
public static ChampionDto ToDto(this Champion champion)
|
|
{
|
|
return new ChampionDto()
|
|
{
|
|
Name = champion.Name,
|
|
Bio = champion.Bio,
|
|
Class = champion.Class.ToDto(),
|
|
Icon = champion.Icon,
|
|
Image = champion.Image.Base64
|
|
};
|
|
}
|
|
|
|
public static Champion ToModel(this ChampionDto championDto)
|
|
{
|
|
return new Champion(championDto.Name, championDto.Class.ToModel(), championDto.Icon, championDto.Image,championDto.Bio);
|
|
}
|
|
|
|
}
|
|
}
|