Example #1
0
        public IActionResult Put(Guid id, [FromBody] ImpedimentoViewModel obj)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != obj.Id)
            {
                return(BadRequest());
            }

            try
            {
                _impedimentoAppService.Alterar(obj);
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ObjExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Example #2
0
        public IActionResult OnPost()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _impedimentoAppService.Alterar(Impedimento);

            return(RedirectToPage("Listar"));
        }