Exemplo n.º 1
0
        public async Task <ActionResult <Indicator> > CreateIndicator([FromBody] Indicator indicator)
        {
            try
            {
                Indicator createdIndicator = await _context.CreateIndicator(indicator);

                return(CreatedAtRoute(nameof(GetIndicator), new { id = createdIndicator.Id }, createdIndicator));
            }
            catch (ControllerNotFoundException e)
            {
                return(NotFound(e.Message));
            }
            catch (ControllerBadRequestException e)
            {
                return(BadRequest(e.Message));
            }
        }
Exemplo n.º 2
0
        public async Task <IActionResult> CreateFileIndicator(FileIndicator indicator)
        {
            Indicator createdIndicator = await _context.CreateIndicator(indicator);

            return(RedirectToAction("Index", "Data"));
        }