public IActionResult Index() { _logger.LogInfo($"Zapytanie do metody Index()"); DisplayErrorFromRedirectIfNecessary(); var result = _doctorRepo.Get(); if (!result.IsSuccess) { AddLocalError(result.FailureMessage); return(View(Enumerable.Empty <DoctorViewModel>())); } var model = Mapper.Map <IEnumerable <DoctorViewModel> >(result.Value); return(View(model)); }
public Result <IEnumerable <DoctorSelectViewModel> > GetDoctorSelectList() { return(Try(() => { var result = _doctorRepo.Get(); if (!result.IsSuccess) { throw new Exception(result.FailureMessage); } return Map <IEnumerable <DoctorSelectViewModel> >(result.Value.Where(x => x.HasValidMedicalLicense)); }, GetType())); }
public IActionResult Get(int id) { var result = _doctorRepo.Get(id); return(Ok(result)); }