I have the following template (DTO):
public class PessoaAcesso : Pessoa
{
[Remote("LoginUnico", "Pessoa", ErrorMessage = "Esse Login já existe! Escolha outro.")]
public virtual string Login { get; set; }
...
}
In my ApiController (WebAPI) I implemented the "LoginUnico" method for testing:
public JsonResult<bool> LoginUnico(string login)
{
return Json(false);
}
However, placing the request via POST is not triggering the method. It was for him to reject the insertion of the new person, but he is accepting.
Anyone who has already implemented Remote () in the WebAPI can guide me.