Esempio n. 1
0
        public async Task <ActionResult <CommandOutput> > CreateCommandOutput([FromBody] CommandOutput CommandOutput)
        {
            try
            {
                CommandOutput createdCommandOutput = await _service.CreateCommandOutput(CommandOutput);

                return(CreatedAtRoute(nameof(GetCommandOutput), new { id = createdCommandOutput.Id }, createdCommandOutput));
            }
            catch (ControllerNotFoundException e)
            {
                return(NotFound(e.Message));
            }
            catch (ControllerBadRequestException e)
            {
                return(BadRequest(e.Message));
            }
        }