Ejemplo n.º 1
0
        private static SinglePersonDto SinglePersonToDo(Person person)
        {
            var ret = new SinglePersonDto
            {
                ID      = person.ID,
                Name    = person.Name,
                Surname = person.Surname,
                Horses  = new List <SingleHorseDto>()
            };

            foreach (var horse in person.Horses)
            {
                var tmpHorse = new SingleHorseDto
                {
                    ID            = horse.ID,
                    BoxID         = horse.BoxID,
                    OwnerID       = horse.OwnerID,
                    OwnerFullName = new string(horse.Owner.Name + " " + horse.Owner.Surname),
                    Name          = horse.Name,
                    MedicEntries  = horse.MedicEntries
                };
                ret.Horses.Add(tmpHorse);
            }
            return(ret);
        }
Ejemplo n.º 2
0
        private static SingleHorseDto HorseToSingleDto(Horse horse)
        {
            var ret = new SingleHorseDto
            {
                ID            = horse.ID,
                BoxID         = horse.BoxID,
                OwnerID       = horse.OwnerID,
                OwnerFullName = new string(horse.Owner.Name + " " + horse.Owner.Surname),
                Name          = horse.Name,
                MedicEntries  = horse.MedicEntries
            };

            return(ret);
        }