Example #1
0
        //public IEnumerable<Disease> GetAllDisease() => diseaseRepository.GetAllDisease();
        public IEnumerable <DiseaseDto> GetAllDisease()
        {
            var diseasefromRepo = diseaseRepository.GetAllDisease();
            var disDto          = new List <DiseaseDto>();

            foreach (var disease in diseasefromRepo)
            {
                disDto.Add(new DiseaseDto()
                {
                    DiseaseId   = disease.DiseaseId,
                    DiseaseName = disease.DiseaseName,
                    DiseaseType = disease.DiseaseType
                });
            }
            return(disDto);
        }