I've found a solution. I have to do 2 things. In the view, I have to add this script:
$(document).ready(function () {
document.getElementById("IdFavorito").removeAttribute("required");;
});
An also I have to make nullable the IdFavorito in PedidoFavorito.cs:
public virtual int? IdFavorito
{
get;
set;
}