As far as I know there is no query that can give you this. When you perform a query task with ReturnGeometry=True, you get the shape of the geometry. You may perform Linq query on this result. For example:
var largest = e.FeatureSet.Features.Max(g => g.Geometry.GetArea());
var graphic = e.FeatureSet.Features.FirstOrDefault(g => g.Geometry.GetArea() == largest);
However, this is not very efficient and the result may not be correct. A diagonal polyline's extent is not necessarily its true area. Also the number of vertices does not always guarantee that it will be the largest polygon.
public static class GeometryExtension
{
public static double GetArea(this Geometry geom)
{
if (geom == null || geom.Extent == null) return 0;
return geom.Extent.Height * geom.Extent.Width;
}
public static int GetVerticesCount(this Geometry geom)
{
if (geom is Polygon)
{
Polygon polygon = geom as Polygon;
if (polygon.Rings == null) return 0;
int count = 0;
foreach (var pc in polygon.Rings)
count += pc.Count;
return count;
}
return 0;
}
}