Currently, tables or feature classes that are not registered with the geodatabase return -1. However, if a table or feature class is opened from a web geodatabase (i.e., connected via Geodatabase.Geodatabase Constructor(ServiceConnectionProperties)), its ID will be the same as its corresponding layer ID.
Requirements
Target Platforms: Windows 10, Windows 8.1, Windows 7