V
volkan
Hi,
I have a student class. In this class i overloaded ==,!= and equals so that
they will compare the studentids ( which is a member of the class ).
However i have a problem with null check.
public static bool operator !=(Student s1, Student s2)
{
...
how can i check if s1 or s2 is null or not in this overload.
if i do s1==null it goes recursive
if i typecast s1 down to object class, it seems not working
any ideas ?
I have a student class. In this class i overloaded ==,!= and equals so that
they will compare the studentids ( which is a member of the class ).
However i have a problem with null check.
public static bool operator !=(Student s1, Student s2)
{
...
how can i check if s1 or s2 is null or not in this overload.
if i do s1==null it goes recursive
if i typecast s1 down to object class, it seems not working
any ideas ?