We have an existing application build using ArcGIS .NET Runtime 10.2.7. We are trying to port the logic to the new 'Quartz' release (v100.0).
The issue I'm facing is trying to port the following logic. We have a url to an existing feature service layer that I want to create an item for (with tags and description).
The problem here seems to be that:
Map and FeatureCollection seem to have a 'SaveAs' method that allows you to save Maps and FeatureCollection as items in a Portal, but in this case I just want to create an item that is a link to an existing Feature Service (layer).
Any help would be greatly appreciated.
Thank you!
Try this for now:
var json = "{ \"url\": \"https://services.arcgis.com/P3ePLMYs2RVChkJx/arcgis/rest/services/USA_Counties/FeatureServer\" }";
var portalItem = new PortalItem(json, portal);
portalItem.Title = "TEST_FS";
portalItem.Type = PortalItemType.FeatureService;
portalItem.Tags.Add("TES");
portalItem.Tags.Add("Wakim National Forest");
portalItem.Tags.Add("Endangered species");
// Set all needed properties on the item
await portal.User.AddPortalItemAsync(portalItem);
I guess the trick is to create the portal item from JSON that contains only the URL (could contain any other properties from the REST spec as well I suppose) and set all the other properties on the resulting portal item before adding it to the portal.