Starting with version 100.11, you can take certain utility network information offline. Associations, which are used to describe containment, structural attachment, and connection between features with non-coincident geometry, can be queried and displayed with offline data. Simple edits can also be made to utility network features while offline and synchronized back to ArcGIS Enterprise.
The following code takes a web map offline that contains a utility network. The utility network tables are automatically synced with a map when a utility network is detected within.
var task = await OfflineMapTask.CreateAsync(map);
var offlineMapParameters = await task.CreateDefaultGenerateOfflineMapParametersAsync(areaOfInterest);
var job = task.GenerateOfflineMap(offlineMapParameters, downloadDirectoryPath);
var result = await job.GetResultAsync();
var utilityNetwork = result.OfflineMap.UtilityNetworks[0];
var parametersOverride = await task.CreateGenerateOfflineMapParameterOverridesAsync(offlineMapParameters);
var overrideKey = new OfflineMapParametersKey(map.UtilityNetworks[0]);
var geodatabaseParameters = parametersOverride.GenerateGeodatabaseParameters[overrideKey];
geodatabaseParameters.UtilityNetworkSyncMode = UtilityNetworkSyncMode.None;
The following code generates a sync-enabled mobile geodatabase from a feature service. By default, only feature data are included unless you specify a sync mode for the utility network.
var task = await GeodatabaseSyncTask.CreateAsync(featureServiceUri);
var parameters = await task.CreateDefaultGenerateGeodatabaseParametersAsync(areaOfInterest);
// Specify a sync mode for utility network
parameters.UtilityNetworkSyncMode = UtilityNetworkSyncMode.SyncSystemTables;
var job = task.GenerateGeodatabase(parameters, pathToGeodatabaseFile);
var geodatabase = await job.GetResultAsync();
For more information about offline workflows using ArcGIS Maps SDKs for Native Apps, see the Offline maps, scenes, and data topic.