Beispiel #1
0
        internal static ComputeOperationListResult DeserializeComputeOperationListResult(JsonElement element)
        {
            IReadOnlyList <ComputeOperationValue> value = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("value"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    List <ComputeOperationValue> array = new List <ComputeOperationValue>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        if (item.ValueKind == JsonValueKind.Null)
                        {
                            array.Add(null);
                        }
                        else
                        {
                            array.Add(ComputeOperationValue.DeserializeComputeOperationValue(item));
                        }
                    }
                    value = array;
                    continue;
                }
            }
            return(new ComputeOperationListResult(value));
        }
Beispiel #2
0
        internal static ComputeOperationListResult DeserializeComputeOperationListResult(JsonElement element)
        {
            Optional <IReadOnlyList <ComputeOperationValue> > value = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("value"))
                {
                    List <ComputeOperationValue> array = new List <ComputeOperationValue>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(ComputeOperationValue.DeserializeComputeOperationValue(item));
                    }
                    value = array;
                    continue;
                }
            }
            return(new ComputeOperationListResult(Optional.ToList(value)));
        }