Name of columns in web service return xml

3

This line gives me this error:

if (db.T_TarefaParceiro.Max(p => p.IDTarefaParceiro) != null)

The error

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.

Because the PathTerminal field is a primary key, it can not be nullable. How do I resolve this?

    
asked by anonymous 27.05.2014 / 02:08

1 answer

4

I solved it like this:

if (db.T_TarefaParceiro.Max(p => (int?)p.IDTarefaParceiro) != null)
    
27.05.2014 / 02:12