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); } } }