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.

38 lines
927 B

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);
}
}
}