예제 #1
0
        public async Task <AddMedicineResponse> AddMedicineAsync(AddMedicineRequest request)
        {
            var            response = new AddMedicineResponse();
            MedicineEntity entity   = _medicineMapper.ToEntity(request);
            bool           status   = await _medicineRepository.AddMedicineAsync(entity);

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