I am trying to query tables from a PortalItemType.FeatureService query. I am using Pro sdk 2.5 so I cant use the ItemFactory.Instance.GetDataset when looping through my Feature Service tables. So I think I need to somehow cast the Features Service to a geodatabase and get the dataset the old way with geodatabse.OpenDataset<Table>. So my question is first, is there an easy way to cast my portal query feature service to a geodatabase, or to use ItemFactory.Instance.GetDataset(selectedItem) on my subitems of my Feature Service (i cant use method in my version of sdk)
PortalQueryParameters query = PortalQueryParameters.CreateForItemsOfTypes(new List<PortalItemType>() { PortalItemType.FeatureService }, "owner", "", "title:MyWebService");
//Loop until done
List<PortalItem> portalItems = new List<PortalItem>();
//run the search
PortalQueryResultSet<PortalItem> results = await portal.SearchForContentAsync(query);
portalItems.AddRange(results.Results);
if (!portalItems.IsNullOrEmpty())
{
string itemID = portalItems[0].ID;
//At this point i have my Feature Service (can i easily cast this to geodatabse??
Item currentFeatureService = ItemFactory.Instance.Create(itemID, ItemFactory.ItemType.PortalItem);
await QueuedTask.Run(() =>
{
//At this point i can loop through the tables to get the one I want
var subItems = currentFeatureService.GetItems();
foreach (var subItem in subItems)
{
if (subItem.Name == "DB.DBO.tableName")
{
//How do i get the dataset at this point without using ItemFactory.Instance.GetDataset(selectedItem). I am in Pro 2.5 right now and cant upgrade yet.
}
}
I cannot figure this part out from the wiki
If you are using ArcGIS Pro 2.8 or previous, then accessing the underlying dataset from the item requires a different pattern