I have been struggling with this issue for hours now and am wondering if anyone else has encountered this.
I have a feature class (
ADDRESS_MANAGER.GIS_INF_ADDRESS_P) and a table (
Using ArcCatalog, I have verified the IDs of the feature class is 987 and the address card table is 981. I have verified the relationship exists from the feature class to the address card table (
Relationship = ADDRESS_MANAGER.AddressCardHasAddress / Label = AddressCard / Origin=ADDRESS_MANAGER.GIS_INF_ADDRESS_P).
However, no relationship classes are returned when I run this code:
var sourceId = sourceTable.GetID().ToString(); // returns "987" var destId = destTable.GetID().ToString(); // returns "981" IReadOnlyList<RelationshipClass> relationshipClasses = geodb.OpenRelationshipClass(sourceId, destId);
I have verified the
geodb object does indeed point to the geodatabase that holds both of these layers -- geodb is set directly from the feature class. Both layer IDs are correct, and there is definitely a relationship class between them. I am porting old ArcObject code over that did something similar, and I cannot figure out how to actually get this RelationshipClass anymore without hardcoding a reference to it.
This is ran in
QueuedTask.Run per the documentation. It doesn't seem to matter if I set up
geodb by opening the appropriate SDE file, or if I set it from the feature class (the geodb is an versioned enterprise geodabatase -- Oracle). Note that I can open the relationship class by
using (RelationshipClass relationshipClass = geodb.OpenDataset<RelationshipClass>("ADDRESS_MANAGER.AddressCardHasAddress"))
This is in ArcGIS Pro 2.2 - using C# / .NET 4.6.2