Hi Chad,
As below is the test result, because the collection won’t keep the sort result, so you should want to call ToList to get the correct result.
InMemoryFeatureLayer layer = new InMemoryFeatureLayer();
Feature f1 = new Feature(0, 0);
f1.ColumnValues.Add(“ColumnName”, “2”);
Feature f2 = new Feature(1, 1);
f2.ColumnValues.Add("ColumnName", "1");
Feature f3 = new Feature(2, 2);
f3.ColumnValues.Add("ColumnName", "3");
layer.InternalFeatures.Add(f1);
layer.InternalFeatures.Add(f2);
layer.InternalFeatures.Add(f3);
layer.Open();
Collection<Feature> features = layer.FeatureSource.GetFeaturesWithinDistanceOf(new PointShape(1, 0), GeographyUnit.DecimalDegree, DistanceUnit.Kilometer, 3000, ReturningColumnsType.AllColumns);
var result1 = features.OrderByDescending(t => t.ColumnValues["ColumnName"]).ToList();
var result2 = features.OrderByDescending(t => t.Id).ToList();
Or you can use IEnumberable instead of Collection like this:
IEnumerable<Feature> features = layer.FeatureSource.GetFeaturesWithinDistanceOf(new PointShape(1, 0), GeographyUnit.DecimalDegree, DistanceUnit.Kilometer, 3000, ReturningColumnsType.AllColumns);
features = features.OrderByDescending(t => t.ColumnValues["ColumnName"]);
Wish that’s helpful.
Regards,
Don