T
test account
I have an interface called IStatus.
I have 2 classes, PurchaseOrder and Invoice. They each have an accessor
named Status that return an object of type IStatus.
I have 4 classes that implement IStatus... InvoiceNote, InvoiceStatus,
PurchaseOrderStatus and PurchaseOrderNote.
Here's the problem, I have 2 PurchaseOrder objects, po1 and po2.
When I do
bool val = (po1.Status == po2.Status).
it seems to do a reference check instead of use the == operator, or the
Equals method of the po1.Status.
I've overriden the Equals method and the == and != operator in all of the
classes. My understanding is, it would use the == operator of the object
returned by po1.Status.
I have 2 classes, PurchaseOrder and Invoice. They each have an accessor
named Status that return an object of type IStatus.
I have 4 classes that implement IStatus... InvoiceNote, InvoiceStatus,
PurchaseOrderStatus and PurchaseOrderNote.
Here's the problem, I have 2 PurchaseOrder objects, po1 and po2.
When I do
bool val = (po1.Status == po2.Status).
it seems to do a reference check instead of use the == operator, or the
Equals method of the po1.Status.
I've overriden the Equals method and the == and != operator in all of the
classes. My understanding is, it would use the == operator of the object
returned by po1.Status.