Method PopulateFromServiceAsync
PopulateFromServiceAsync(QueryParameters, Boolean, IEnumerable<String>)
Queries the feature service and places the resulting features in the local table, which is cached for the duration of the session. The ServiceFeatureTable must have its FeatureRequestMode set to ManualCache.
Declaration
public Task<FeatureQueryResult> PopulateFromServiceAsync(QueryParameters parameters, bool clearCache, IEnumerable<string> outFields)
Parameters
Type | Name | Description |
---|---|---|
QueryParameters | parameters | The QueryParameters used to filter feature results. |
Boolean | clearCache | If true, then ClearCache(Boolean) will be called before populating the local table. If false, the resulting features will be appended to the local table. |
IEnumerable<System.String> | outFields | An IEnumerable<T> containing System.String. Each string is the name of a field to be used when populating the cache. If the array contains the single element "*", then all fields will be used. If the ObjectID field string name is not provided as part of the IEnumerable<T>, no features will be returned for this method. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<FeatureQueryResult> | A task that represents the asynchronous populate from service operation. The value of the task result is a FeatureQueryResult object. |
Remarks
This method is useful for non-geographic data. It's also helpful when you want to avoid accessing the service for a feature whose geometry is in the current extent of the map or scene.
Specifying null
or an empty IEnumerable<T> for the outfields results in the
minimum set of fields being used when populating the local table. This is the same set of
attributes described for OnInteractionCache or
OnInteractionNoCache.
Applies to
Platforms and versions
Target | Versions |
---|---|
.NET Standard 2.0 | 100.3 - 100.15 |
.NET 6.0 | 100.13 - 100.15 |
.NET 6.0 Windows | 100.13 - 100.15 |
.NET Framework | 100.0 - 100.15 |
.NET 5 | 100.10 - 100.12 |
.NET Core 3.1 | 100.7 - 100.12 |
Xamarin.Android | 100.0 - 100.15 |
Xamarin.iOS | 100.0 - 100.15 |
UWP | 100.0 - 100.14 |
Relevant samples
PopulateFromServiceAsync(QueryParameters, Boolean, IEnumerable<String>, CancellationToken)
Asynchronously performs manual query of data from the service and imports feature results into the table.
Declaration
public Task<FeatureQueryResult> PopulateFromServiceAsync(QueryParameters parameters, bool clearCache, IEnumerable<string> outFields, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
QueryParameters | parameters | The QueryParameters used to filter feature results. |
Boolean | clearCache | A value indicating whether to clear cache before populating the table. |
IEnumerable<System.String> | outFields | The attribute fields to include in the result. |
CancellationToken | cancellationToken | A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<FeatureQueryResult> | A task that represents the asynchronous populate from service operation. The value of the task result is a FeatureQueryResult object. |
Applies to
Platforms and versions
Target | Versions |
---|---|
.NET Standard 2.0 | 100.3 - 100.15 |
.NET 6.0 | 100.13 - 100.15 |
.NET 6.0 Windows | 100.13 - 100.15 |
.NET Framework | 100.0 - 100.15 |
.NET 5 | 100.10 - 100.12 |
.NET Core 3.1 | 100.7 - 100.12 |
Xamarin.Android | 100.0 - 100.15 |
Xamarin.iOS | 100.0 - 100.15 |
UWP | 100.0 - 100.14 |