So I have both classes in the same diagram. I can add persistent associations just fine. The extension method works as desired. The problem I'm having is with derived associations. I cannot get them to work. My latest attempt gives an error in the extender code:
private static void EnsureMemberIndex(Vco.PartyPackage.Application obj) { if ((memberIndex == -1)) { memberIndex = OtherEndExtenderHelper.GetMemberIndexOfOtherEnd(obj, typeof(Vco.ProductPackage.Product), Vco.ProductPackage.Product.Eco_LoopbackIndices.Application2); }}
I get an "Object reference not set to an instance of an object" error when OtherEndExtenderHelper.GetMemberIndexOfOtherEnd is called.
Has anyone got a derived association between two packages to work?
Thanks,
Brian
The bug report details things and has the sample app attached.
I just want to add that I love the concept of using extension methods to access associations from classes that know nothing of the class on the other end. It really provides a nice way to break models up into reusable modules. I can't wait until Microsoft finally implements extension propterties. My fingers are crossed for .NET 5.