public IEnumerable <PetDetailsDto> FindAll() { IEnumerable <PetDetails> petdetails = transRepos.FindAll(); IEnumerable <PetDetailsDto> pt = from g in petdetails select new PetDetailsDto { Age = g.Age, BreedType = g.BreedType, PetName = g.PetName, ImagePath = g.ImagePath, Price = g.Price, PetType = g.pet.PetType }; return(pt.ToList()); }