SuperMap.Web.ISDotNET6.Entity.FromJson C# (CSharp) Method

FromJson() public static method

${IS6_Entity_method_fromJSON_D}
public static FromJson ( System.Json.JsonObject jsonObject ) : Entity
jsonObject System.Json.JsonObject ${IS6_Entity_method_fromJSON_param}
return Entity
        public static Entity FromJson(JsonObject jsonObject)
        {
            if (jsonObject == null)
            {
                return null;
            }

            Entity entity = new Entity();

            entity.ID = jsonObject["id"];

            entity.Shape = ServerGeometry.FromJson((JsonObject)jsonObject["shape"]);

            //fieldValue
            JsonArray jsonValue = (JsonArray)jsonObject["fieldValues"];
            if (jsonValue != null && jsonValue.Count > 0)
            {
                entity.FieldValues = new List<string>();
                for (int i = 0; i < jsonValue.Count; i++)
                {
                    entity.FieldValues.Add(jsonValue[i]);
                }
            }

            //fieldNames
            JsonArray jsonNames = (JsonArray)jsonObject["fieldNames"];
            if (jsonNames != null && jsonNames.Count > 0)
            {
                entity.FieldNames = new List<string>();
                for (int i = 0; i < jsonNames.Count; i++)
                {
                    entity.FieldNames.Add(jsonNames[i]);
                }
            }

            return entity;
        }