Esempio n. 1
0
        public async Task <IActionResult> Get(int id)
        {
            DecisionDTO decisionDto = await _decisionService.GetDecisionAsync(id);

            if (decisionDto == null)
            {
                return(NotFound());
            }

            return(Ok(decisionDto));
        }
Esempio n. 2
0
        public async Task <JsonResult> GetDecision(int id)
        {
            bool     success  = true;
            Decision decision = null;

            try
            {
                decision = _mapper.Map <Decision>(await _decisionService.GetDecisionAsync(id));
            }
            catch (Exception e)
            {
                _loggerService.LogError($"{e.Message}");
                success = false;
            }

            return(Json(new { success, decision }));
        }