Esempio n. 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);
        }
Esempio n. 2
0
        public async Task <IActionResult> AddTreatment([FromBody] AddTreatmentRequest request)
        {
            var response = await _treatmentService.AddTreatmentAsync(request);

            return(GenerateResponse(response));
        }