SPPersistedObject.ToString Method
Returns the type and name of an object and of all its ancestors (parent, grandparent, and so on).
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online