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.
League-of-Legends_Project/EntityFramework_LoL/Sources/ApiMappeur/SkinMapper.cs

38 lines
823 B

using DTO;
using Entities;
using Model;
namespace ApiMappeur
{
public static class SkinMapper
{
public static Skin ToModel(this SkinEntity entity)
{
throw new NotImplementedException();
}
public static SkinDto ToDto(this Skin item)
{
return new SkinDto()
{
Name = item.Name,
LargeImage = item.Image.ToDTO(),
Description = item.Description,
Icon = item.Icon,
Price = item.Price,
};
}
public static Skin ToModel(this SkinDto item)
{
var image = item?.LargeImage?.base64 ?? "";
return new(item?.Name ?? "", null, item?.Price ?? -1, image, item?.Description ?? "");
}
}
}