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 _remedyFieldCou nt
public int RemedyFieldCoun t
{
get
{
if (_remedyFieldCo unt == null) // The result of the
expression is always 'false' since a value of type 'int' is never
equal to 'null' of type 'int?'
{
_remedyFieldCou nt = ... do
initialisation }
}
return _remedyFieldCou nt;
}
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 _remedyFieldCou nt
public int RemedyFieldCoun t
{
get
{
if (_remedyFieldCo unt == null) // The result of the
expression is always 'false' since a value of type 'int' is never
equal to 'null' of type 'int?'
{
_remedyFieldCou nt = ... do
initialisation }
}
return _remedyFieldCou nt;
}
Comment