Found that by adding featurelayers to the current active map using something like:
LayerFactory.Instance.CreateLayer<FeatureLayer>(layerParams, MapView.Active.Map);
it's faster to query against this feature layer using:
var featureLayer = //get from layer added to map already
using (var table = featureLayer.GetTable())
var queryFilter = new QueryFilter
{WhereClause = whereClause,};
using (var rowCursor = table.Search(queryFilter))
...
I know there is a setting on the featurelayer from ArcPro to refresh the layer periodically... (see attachment)
My concern is does this mean that data can be stale between these refresh intervals, or even if the setting is turned off? Does query return the latest/real time data always, or does it return the cached data?
Solved! Go to Solution.
A direct query to the data/layer made in the SDK should always hit the database.
A direct query to the data/layer made in the SDK should always hit the database.
So (just to confirm) you're saying that the query i am using, as below, is always hitting the database?
var featureLayer = //get from layer added to map already
using (var table = featureLayer.GetTable())
var queryFilter = new QueryFilter
{WhereClause = whereClause,};
using (var rowCursor = table.Search(queryFilter))
...
Thanks.
Correct! It should query the underlying database.