As in title, I have a code, where I recieve DbNull type with null value, when there is no geometry in database and DbGeometry get null value. But when I want to make an if statement to check if DbGeometry equals to DbNull.Value I can't do that. It's something like this:
var geom = entity.Select(entity => entity.Geom);
if (geom == DbNull.Value) return null; // Here it is not valid for VisualStudio
But when i do something like that:
if (geom == null) return null;
It works just fine. Why I get an error when I try to compare geom variable which is a DbGeometry type with DbNull.Value even though without handling a null I get a DbNull type.