Exemple #1
0
        public async Task <IActionResult> GetHospital(int id)
        {
            var hospital = await repository.GetHospital(id);

            var result = mapper.Map <Entities.Models.Hospital, HospitalResource>(hospital);

            return(Ok(result));
        }
Exemple #2
0
        public Hospital GetHospital(string id)
        {
            var entity = _repoHospital.GetHospital(id);

            if (entity == null)
            {
                throw new BusinessException($"不存在对应的医院:id = <{entity.Id}>");
            }
            return(entity);
        }
Exemple #3
0
        //public Hospital GetHospital(int HospitalId) => hospitalRepository.GetHospital(HospitalId);
        public ActionResult GetHospital(int HospitalId)
        {
            List <HospitalDto> hospital = new List <HospitalDto>();

            hospital = hospitalRepository.GetHospital(HospitalId);
            if (hospital == null)
            {
                return(NotFound());
            }
            return(Ok(hospital));
        }