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.
42 lines
965 B
42 lines
965 B
using System;
|
|
using EFLib;
|
|
|
|
namespace ApiLol
|
|
{
|
|
public static class ChampionMapper
|
|
{
|
|
public static ChampionDTO ToDto(this ChampionEntity champion)
|
|
{
|
|
if (champion == null)
|
|
{
|
|
throw new NullReferenceException();
|
|
}
|
|
return new ChampionDTO
|
|
{
|
|
Name = champion.Name,
|
|
Bio = champion.Bio,
|
|
Icon = champion.Icon,
|
|
Id = champion.Id,
|
|
ChampClass = champion.ChampClass
|
|
};
|
|
}
|
|
|
|
public static ChampionEntity ToEntity(this ChampionDTO champion)
|
|
{
|
|
if (champion == null)
|
|
{
|
|
throw new NullReferenceException();
|
|
}
|
|
return new ChampionEntity
|
|
{
|
|
Name = champion.Name,
|
|
Bio = champion.Bio,
|
|
Icon = champion.Icon,
|
|
Id = champion.Id,
|
|
ChampClass = champion.ChampClass
|
|
};
|
|
}
|
|
}
|
|
}
|
|
|