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.
32 lines
820 B
32 lines
820 B
using DTO;
|
|
using Model;
|
|
|
|
namespace API_LoL_Project.Mapper
|
|
{
|
|
public static class RuneMapper
|
|
{
|
|
public static RuneDTO ToDTO(this Rune item)
|
|
{
|
|
|
|
return new RuneDTO()
|
|
{
|
|
Name = item.Name,
|
|
Family = item.Family,
|
|
};
|
|
}
|
|
|
|
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);
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|