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.
39 lines
856 B
39 lines
856 B
using System;
|
|
using Model;
|
|
using static System.Net.Mime.MediaTypeNames;
|
|
using System.Xml.Linq;
|
|
using ApiLol.DTO;
|
|
|
|
namespace ApiLol.Mapping
|
|
{
|
|
public static class RuneMapper
|
|
{
|
|
public static RuneDTO ToDto(this Rune rune)
|
|
{
|
|
|
|
if (rune == null)
|
|
{
|
|
throw new NullReferenceException();
|
|
}
|
|
return new RuneDTO
|
|
{
|
|
Name = rune.Name,
|
|
Description = rune.Description,
|
|
Family = rune.Family,
|
|
Icon = rune.Icon
|
|
};
|
|
|
|
}
|
|
|
|
public static Rune ToPoco(this RuneDTO rune) {
|
|
if (rune == null)
|
|
{
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
return new Rune(rune.Name, rune.Family, rune.Icon, rune.Description);
|
|
}
|
|
}
|
|
}
|
|
|