// Define the feature layer and feature ID FeatureLayer featureLayer = ...; long featureId = ...; // Retrieve the feature by ID Feature feature = await featureLayer.FeatureTable.QueryAsync(featureId); // Get the feature definition IFeatureDefinition definition = feature.GetDefinition();
// Define the feature layer FeatureLayer featureLayer = ...; // Get all the features in the layer FeatureQueryResult featureResult = await featureLayer.FeatureTable.QueryAsync(new QueryParameters() { WhereClause = "1=1" }); // Loop through all the features and get their definitions foreach (Feature feature in featureResult) { IFeatureDefinition definition = feature.GetDefinition(); // Perform operations on the feature using the definition }The `IFeature.GetDefinition` method is part of the `Esri.ArcGISRuntime.Data` package library in the ArcGIS Runtime SDK for .NET.