string json = "{\"hasM\":true,\"paths\":[[[5,4,6],[6,4,5],[8,6,7]],[[0,0,1],[0,1,0],[1,1,-1],[1,0,-2]]]}";
Polyline polyline = PolylineBuilderEx.FromJson(json);
double firstM, lastM;
GeometryEngine.Instance.QueryFirstLastM(polyline, out firstM, out lastM);
// firstM = 6, lastM = -2
json = "{\"hasM\":true,\"paths\":[[[5,4,null],[6,4,5],[8,6,7]],[[0,0,1],[0,1,0],[1,1,-1],[1,0,null]]]}";
polyline = PolylineBuilderEx.FromJson(json);
GeometryEngine.Instance.QueryFirstLastM(polyline, out firstM, out lastM);
// firstM = 5, lastM = -1
json = "{\"hasM\":true,\"paths\":[[[5,4,null],[6,4,null],[8,6,null]],[[0,0,null],[0,1,null],[1,1,null],[1,0,null]]]}";
polyline = PolylineBuilderEx.FromJson(json);
GeometryEngine.Instance.QueryFirstLastM(polyline, out firstM, out lastM);
// firstM and lastM are NaN
json = "{\"hasM\":true,\"paths\":[]}";
polyline = PolylineBuilderEx.FromJson(json);
GeometryEngine.Instance.QueryFirstLastM(polyline, out firstM, out lastM);
// firstM and lastM are NaN