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