Ejemplo n.º 1
0
        private static void WriteValidateFunction(JsonWriter writer, IDesignDocument doc)
        {
            var validateProperty = doc.GetType().GetTypeInfo().GetProperty("ValidateDocUpdate");

            if (validateProperty != null)
            {
                WriteProperty(writer, "validate_doc_update", ((FunctionSpec)validateProperty.GetValue(doc)).Content);
            }
        }
Ejemplo n.º 2
0
        private static void WriteSection <TSectionInterface>(IDesignDocument doc, string sectionName, JsonWriter writer, JsonSerializer serializer)
        {
            var sectionType = doc.GetType().GetTypeInfo().GetNestedTypes().SingleOrDefault(t => t.ImplementsInterface(typeof(TSectionInterface)));

            if (sectionType != null)
            {
                writer.WritePropertyName(sectionName);
                serializer.Serialize(writer, ReflectSectionFunctions(sectionType));
            }
        }