internal static IndexBatch DeserializeIndexBatch(JsonElement element)
        {
            IndexBatch result = new IndexBatch();

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("value"))
                {
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        result.Actions.Add(IndexAction.DeserializeIndexAction(item));
                    }
                    continue;
                }
            }
            return(result);
        }
예제 #2
0
        internal static IndexAction DeserializeIndexAction(JsonElement element)
        {
            IndexAction result = new IndexAction();

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("@search.action"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    result.ActionType = property.Value.GetString().ToIndexActionType();
                    continue;
                }
                result.Add(property.Name, property.Value.GetObject());
            }
            return(result);
        }