Пример #1
0
        SqlStoredProcedure IOperationSource <SqlStoredProcedure> .CreateResult(Response response, CancellationToken cancellationToken)
        {
            using var document = JsonDocument.Parse(response.ContentStream);
            var data = SqlStoredProcedureData.DeserializeSqlStoredProcedureData(document.RootElement);

            return(new SqlStoredProcedure(_armClient, data));
        }
        internal static SqlStoredProcedureList DeserializeSqlStoredProcedureList(JsonElement element)
        {
            Optional <IReadOnlyList <SqlStoredProcedureData> > value = default;

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