Beispiel #1
0
        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
        {
            var action = (IndexAction <T>)value;

            var injectingWriter = new InjectingJsonWriter(writer);

            injectingWriter.OnStart =
                w =>
            {
                w.WritePropertyName("@search.action");
                w.WriteValue(SearchIndexClient.IndexActionTypeToString(action.ActionType));
            };

            serializer.Serialize(injectingWriter, action.Document);
        }