Ejemplo n.º 1
0
        public static PetDTO generatePetById(Pet pet)
        {
            PetDTO petDTO = new PetDTO()
            {
                Id              = pet.Id,
                AccomodationId  = pet.AccomodationId,
                Name            = pet.Name,
                PetAccomodation = pet.PetAccomodation,
                PetHealth       = pet.PetHealth,
                PetOwner        = pet.PetOwner,
                PetPhotograph   = pet.PetPhotograph
            };

            return(petDTO);
        }
Ejemplo n.º 2
0
        public static List <PetDTO> generatePetDTO(List <Pet> pets)
        {
            List <PetDTO> listPetsDTO = new List <PetDTO>();

            foreach (Pet pet in pets)
            {
                PetDTO petDTO = new PetDTO()
                {
                    AccomodationId  = pet.AccomodationId,
                    Id              = pet.Id,
                    PetAccomodation = pet.PetAccomodation,
                    Name            = pet.Name,
                    PetHealth       = pet.PetHealth,
                    PetOwner        = pet.PetOwner,
                    PetPhotograph   = pet.PetPhotograph
                };
                listPetsDTO.Add(petDTO);
            }
            return(listPetsDTO);
        }