What's the preferred way of checking if the value is null
?
Let's say we have some entity, which has properties, which can be null
(some of them or all of them).
And I wish to check this in runtime, if some property is actually null
or not.
Would you use simple Entity.Property != null
check in this case or would you implement a specific method, let's say like
bool HasProperty() {
return Property != null;
}
What would you choose and why?