ArcGIS Pro 2.6 API Reference Guide
FromJson Method (GeometryBagBuilder)
Example 

ArcGIS.Core.Geometry Namespace > GeometryBagBuilder Class : FromJson Method
JSON string representation of GeometryBag.
Creates a new instance of a GeometryBag class from a JSON string representation.
Syntax
public static GeometryBag FromJson( 
   string jsonString
)
Public Shared Function FromJson( _
   ByVal jsonString As String _
) As GeometryBag

Parameters

jsonString
JSON string representation of GeometryBag.

Return Value

Exceptions
ExceptionDescription
The jsonString is empty or null.
JSON string is invalid or does not represent a GeometryBag string.
Example
const string jsonString = "{\"geometries\":[{\"x\":1,\"y\":2},{\"rings\":[[[0,0],[0,4],[3,4],[3,0],[0,0]]]}],\"spatialReference\":{\"wkid\":4326,\"latestWkid\":4326}}";
GeometryBag geometryBag = GeometryBagBuilder.FromJson(jsonString);

string xml = geometryBag.ToXML();
GeometryBag xmlString = GeometryBagBuilder.FromXML(xml);
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 7

See Also

Reference

GeometryBagBuilder Class
GeometryBagBuilder Members