示例#1
0
        public async Task <AddTreatmentResponse> AddTreatmentAsync(AddTreatmentRequest request)
        {
            var             response = new AddTreatmentResponse();
            TreatmentEntity entity   = _treatmentMapper.ToEntity(request);
            bool            status   = await _treatmentRepository.AddTreatmentAsync(entity);

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

            return(response);
        }