tags:

views:

52

answers:

2

I am using the FirstOrDefault<T>() method to return an object from a Linq2Sql query. I then set an object to be equal to the returned value.

how do I test if the default has been returned?

+3  A: 

If T is a non-primitive data type I believe the default value will be null.

jwarzech
Thanks, that is what I originally thought, but I seemed to be getting a new object of the type being returned. Think I had some rogue data returning an object. You are absolutely right though thanks.
Richbits
+2  A: 

using the comparison with default(T)

Gregoire