using API.Dto; using Model; namespace API.Mapping { public static class SkinMapper { public static SkinDto ToDto(this Skin skin) { if (skin == null) { throw new ArgumentNullException("Skin null"); } return new SkinDto() { Name = skin.Name, Champion = skin.Champion, Price = skin.Price, Icon = skin.Icon, Image = skin.Image, Description = skin.Description }; } public static Skin ToSkin(this SkinDto skinDto) { if (skinDto == null) { throw new ArgumentNullException("SkinDto null"); } return new Skin(skinDto.Name, skinDto.Champion, skinDto.Price, skinDto.Icon, skinDto.Image.Base64, skinDto.Description); } } }