コード例 #1
0
        public async Task <Result <PatientStartTreatmentResponse> > Handle(PatientStartTreatmentCommand request, CancellationToken cancellationToken)
        {
            try
            {
                PharmacyService pharm = new PharmacyService(_unitOfWork);


                var result = await pharm.HasPatientTreatmentStarted(request.PatientId);


                return(Result <PatientStartTreatmentResponse> .Valid(new PatientStartTreatmentResponse
                {
                    StartTreatment = result
                }));
            }
            catch (Exception ex)
            {
                return(Result <PatientStartTreatmentResponse> .Invalid(ex.Message));
            }
        }