I'm having the following error, I perform the following operation:
// POST: api/Funcionario/AddFuncionario
[HttpPost("AddFuncionario")]
public IActionResult AddFuncionario([FromBody] Funcionario Func)
{
if(Func == null)
{
return BadRequest();
}
funcionarioRepository.AddFuncionario(Func);
return CreatedAtRoute("BuscarPorId/{id}", new { id = Func.Id }, Func);
}
Follow my Action from Api:
[HttpGet("BuscarPorId/{id}")]
public IActionResult BuscarPorId(int id)
{
var item = funcionarioRepository.BuscarPorFuncionario(id);
return new ObjectResult(item);
}