When I view an AFElement in dev environment I can see a PrimaryPathFromDatabase property, but that property and/or method is not exposed in the object model. Wondering How I can get at that property
myElement.GetPath(myElement.Database) will produce the same result with one notable exception:
If the element, or any of the elements in the primary path chain are also defined at the database level, but that reference is not the primary, GetPath will short-circuit to this shorter path.
For example, Consider database with root Element E1, which has child E2 which has child E3. Adding E2 to the database root, then calling the GetPath method on E3 relative to the database would result in the shortened path "E2\E3", instead of the path "E1\E2\E3". Both paths are valid paths from the database to the same element. If this distinction is not important to your app, or not possible to occur within your database, you can use the GetPath method.
myElement.GetPath() returns a complete path including the host name. PrimaryPathFromDatabase, does not include the host name.
There are 3 overloads for GetPath. You need to use GetPath(relativeTo) and supply the database as the relativeTo parameter. This returns the path relative to the database.
Retrieving data ...