SqlUserDefinedFunction IOperationSource <SqlUserDefinedFunction> .CreateResult(Response response, CancellationToken cancellationToken)
        {
            using var document = JsonDocument.Parse(response.ContentStream);
            var data = SqlUserDefinedFunctionData.DeserializeSqlUserDefinedFunctionData(document.RootElement);

            return(new SqlUserDefinedFunction(_armClient, data));
        }
コード例 #2
0
        internal static SqlUserDefinedFunctionList DeserializeSqlUserDefinedFunctionList(JsonElement element)
        {
            Optional <IReadOnlyList <SqlUserDefinedFunctionData> > value = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("value"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <SqlUserDefinedFunctionData> array = new List <SqlUserDefinedFunctionData>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(SqlUserDefinedFunctionData.DeserializeSqlUserDefinedFunctionData(item));
                    }
                    value = array;
                    continue;
                }
            }
            return(new SqlUserDefinedFunctionList(Optional.ToList(value)));
        }