D
damiensawyer
Hi,
I've recently moved to c# framework 2 and have just discovered the
comiler warning "The result of the expression is always 'false' since
a value of type 'int' is never equal to 'null' of type 'int?'"
Can someone please tell me best practise for determining in properties
if an int has been initialised?
Thanks very much in advance,
Damien
private _remedyFieldCount
public int RemedyFieldCount
{
get
{
if (_remedyFieldCount == null) // The result of the
expression is always 'false' since a value of type 'int' is never
equal to 'null' of type 'int?'
{
_remedyFieldCount = ... do
initialisation }
}
return _remedyFieldCount;
}
I've recently moved to c# framework 2 and have just discovered the
comiler warning "The result of the expression is always 'false' since
a value of type 'int' is never equal to 'null' of type 'int?'"
Can someone please tell me best practise for determining in properties
if an int has been initialised?
Thanks very much in advance,
Damien
private _remedyFieldCount
public int RemedyFieldCount
{
get
{
if (_remedyFieldCount == null) // The result of the
expression is always 'false' since a value of type 'int' is never
equal to 'null' of type 'int?'
{
_remedyFieldCount = ... do
initialisation }
}
return _remedyFieldCount;
}