When i am querying database with .FirstOrDefault
method, how do i handle results that it has given to me? I am especially concerned about null values, currently i have something like that:
if (result == default(TypeOfResult))
{
handleIt();
}
But i do not exactly know what is this "default", so i am wondering if it wasn't better to do it this way:
if (result == null)
{
handleIt();
}
which one would work? And what exactly is this "default"?