Trying to wire up a basic table query, but not having much luck. The goal would be to add some initial support for relationships (I know it's coming soon), but we have folks asking for it now.
To test/develop, we downloaded the manhole inspection template from the water data model and published it to AGOL. The only change made was to link based on GlobalId, rather than FacilityId.
There is currently only one record, with a single related record. The related record was created using Collector (maybe that was the issue??). Everything works fine if you add the data to an AGOL web map, we can see the related record.
The following code returns no records, although using the same query directly on the REST API returns the record.
<SPAN class="keyword token">var</SPAN> destTable <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">ServiceFeatureTable</SPAN> <SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">Uri</SPAN> <SPAN class="punctuation token">(</SPAN>
<SPAN class="string token"><SPAN>"</SPAN><A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fservices6.arcgis.com%2Fv1B7paWSaOfBIIVv%2FArcGIS%2Frest%2Fservices%2FManholeInspections%2FFeatureServer%2F1" target="_blank">http://services6.arcgis.com/v1B7paWSaOfBIIVv/ArcGIS/rest/services/ManholeInspections/FeatureServer/1</A><SPAN>"</SPAN></SPAN>
<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
destTable<SPAN class="punctuation token">.</SPAN>FeatureRequestMode <SPAN class="operator token">=</SPAN> FeatureRequestMode<SPAN class="punctuation token">.</SPAN>OnInteractionCache<SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">await</SPAN> destTable<SPAN class="punctuation token">.</SPAN>LoadAsync <SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">var</SPAN> query <SPAN class="operator token">=</SPAN> <SPAN class="string token">"ManholeNumber = 'dd11f844-16b0-4e86-9fbd-ca77275dba0e'"</SPAN><SPAN class="punctuation token">;</SPAN>
FeatureQueryResult queryResult <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">await</SPAN> destTable<SPAN class="punctuation token">.</SPAN>QueryFeaturesAsync <SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">QueryParameters</SPAN> <SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN>
WhereClause <SPAN class="operator token">=</SPAN> query
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">,</SPAN> QueryFeatureFields<SPAN class="punctuation token">.</SPAN>LoadAll<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">var</SPAN> ftrs <SPAN class="operator token">=</SPAN> queryResult<SPAN class="punctuation token">.</SPAN>ToList <SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>ftrs<SPAN class="punctuation token">.</SPAN>Any <SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN>
<SPAN class="comment token">//Handle the results</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">;</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>