Ejemplo n.º 1
0
        public async Task <DeleteTreatmentResponse> DeleteTreatmentAsync(DeleteTreatmentRequest request)
        {
            var             response = new DeleteTreatmentResponse();
            TreatmentEntity entity   = await _treatmentRepository.GetTreatmentById(request.Id);

            if (entity == null)
            {
                response.StatusCode = (int)HttpStatusCode.NotFound;
                return(response);
            }

            bool status = await _treatmentRepository.DeleteTreatmentAsync(entity);

            if (status)
            {
                response.StatusCode = (int)HttpStatusCode.OK;
            }
            else
            {
                response.StatusCode = (int)HttpStatusCode.BadRequest;
                //TODO (okandavut) : LOGGING
                _logger.LogWarning("");
            }

            return(response);
        }