I need to return a specific message, where it has Get
, but it is not working as expected and I tried to implement it separately but it always gives error .
[ResponseType(typeof(pessoa))]
[ActionName("GetCNPJCPF")]
public IHttpActionResult GetCNPJCPF(string cnpj_cpf)
{
pessoa pessoa = db.pessoa.OfType<pessoa>()
.Where(p => p.cpf_cnpj == cnpj_cpf).FirstOrDefault();
if (pessoa == null)
{
return NotFound();
}
return Ok(pessoa);
}
If it does not simply find the HTTP 404 error