public IEnumerable <MedicoVetViewModel> SearchAll() { var medicoVetEntt = _medicoVet.SearchAll(); var medicoVetVM = new List <MedicoVetViewModel>(); foreach (var item in medicoVetEntt) { medicoVetVM.Add(Mapper.Map <MedicoVeterinario, MedicoVetViewModel>(item)); } return(medicoVetVM); }
public MedicoVetAnimal getAnimalMedico() { var AnimalMedic = new MedicoVetAnimal(); AnimalMedic.animais = Mapper.Map <IEnumerable <Animal>, IEnumerable <AnimalViewModel> >(_animalApp.SearchAll()); AnimalMedic.medicoVeterinarios = Mapper.Map <IEnumerable <MedicoVeterinario>, IEnumerable <MedicoVetViewModel> >(_medicoApp.SearchAll()); return(AnimalMedic); }