I just upgraded to 2.4 and followed the steps in the Upgrading guide. All went well in the business objects. Then I started compiling my projects to see what needs changed.
I have several routines where I am passing business objects or I have a public property that is a business object. I'm having a hard time figuring out how to handle this with the generics.
One example: I have a constructor:
public DataDup(ABusinessObject bizObj, CopyType copyType,bool primaryBizObj, string foreignKey)
That was working fine. After adding the generics, the I got a compiler error and change the first parameter to ABusinessObject
made the compiler happy. Unfortunately, I can't seem to fix the error in the calling routine. The compiler complains that it can't convert the specific business object (AddressesShipping) to the generic (ABusinessObject.
I can change the first parameter to an object, then cast it to ABusinessObject when I use or store it, but that does not seem like a very safe solution.
I guess the question boils down to: How do I pass the new business object to a method?
Thanks,
Jeff