3
That line gives me that mistake:
if (db.T_TarefaParceiro.Max(p => p.IDTarefaParceiro) != null)
The mistake
The cast to value type 'System.Int32' failed because the materialized value is null. Either the result type's generic parameter or the query must use a nullable type.
Since the Idtarepartner field is a primary key, it cannot be nullable. How do I resolve this?