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/RuneMapper.cs

38 lines
953 B

using DTO;
using Model;
using System.Text;
using Rune = Model.Rune;
namespace ApiMappeur
{
public static class RuneMapper
{
public static RuneDTO ToDTO(this Rune item)
{
return new RuneDTO
{
Name = item.Name,
Description = item.Description,
Family = item.Family,
Icon = item.Icon,
Image = item.Image
};
}
public static Rune ToModel(this RuneDTO dto)
{
/*if (dto == null)
{
*//* var message = string.Format("Champion with name = {} not found", dto.Name);
throw new HttpResponseException(Request.CreateErrorResponse(HttpStatusCode.NotFound, message));*//*
}*/
return new Rune(dto.Name, dto.Family, dto.Icon, dto.Image.Base64, dto.Description);
}
}
}