To connect to data in an enterprise geodatabase (previously ArcSDE) we recommend you publish the feature classes / tables within a feature service. If you want something really adhoc (and read-only), then it is possible via the Local Server component of ArcGIS Runtime (which is where the code above comes in). The "DynamicLayer" capability of the MapServer endpoint for both ArcGIS Enterprise and the ArcGIS Runtime Local Server allows you to completely customize the contents of a map service, including connecting to feature classes / tables in an enterprise geodatabase. (for more info see ArcGIS REST API).

The API types to do that are available in 10.2.7 but not currently in v100.0, although they are on the roadmap for the next release. Note that use of the Local Server may necessitate additional licensing depending on what other functionality you already use (for more info see License your app—ArcGIS Runtime SDK for .NET | ArcGIS for Developers).