Beispiel #1
0
        public Ork MapToDomain(DbOrk ork)
        {
            var mapped = new Ork
            {
                Id        = ork.Id,
                Name      = ork.Name,
                KillCount = ork.KillCount,
                Weapons   = (ork.Weapons ?? new List <DbOrkWeapon>()).Select(w => Enum.Parse <Weapons>(w.Weapon)).ToList()
            };

            return(mapped);
        }
Beispiel #2
0
        public DbOrk MapToEntity(Ork ork)
        {
            var mapped = new DbOrk
            {
                Id        = ork.Id,
                KillCount = ork.KillCount,
                Name      = ork.Name,
                Weapons   = ork.Weapons.Select(w => new DbOrkWeapon
                {
                    Weapon = w.ToString()
                }).ToList()
            };

            return(mapped);
        }