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));
            }
        }
示例#2
0
        public async Task <IActionResult> CreateFileIndicator(FileIndicator indicator)
        {
            Indicator createdIndicator = await _context.CreateIndicator(indicator);

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