public ApiDocumentation(string vocab, string id, Class[] supportedClasses) { SupportedClasses = supportedClasses; Id = id; Context = new Dictionary<string, object> { {"hydra", "http://www.w3.org/ns/hydra/core#"}, {"vocab", vocab}, {"ApiDocumentation", "hydra:ApiDocumentation"}, {"property", new Link {Id = "hydra:property"}}, {"readonly", "hydra:readonly"}, {"writeonly", "hydra:writeonly"}, {"supportedClass", "hydra:supportedClass"}, {"supportedProperty", "hydra:supportedProperty"}, {"supportedOperation", "hydra:supportedOperation"}, {"method", "hydra:method"}, {"expects", new Link {Id = "hydra:expects"}}, {"returns", new Link {Id = "hydra:returns"}}, {"statusCodes", "hydra:statusCodes"}, {"code", "hydra:statusCode"}, {"rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#"}, {"rdfs", "http://www.w3.org/2000/01/rdf-schema#"}, {"label", "rdfs:label"}, {"description", "rdfs:comment"}, {"domain", new Link {Id = "rdfs:domain"}}, {"range", new Link {Id = "rdfs:range"}}, {"subClassOf", new Link {Id = "hydra:subClassOf"}} }; }
private static void WriteDocToDisk(string format, string docDir, Class clazz, string classDoc) { if ("true".Equals(ConfigurationManager.AppSettings["write-docs-to-disk"], StringComparison.InvariantCultureIgnoreCase)) { string extension = "." + VocabHelpers.GetExtension(format); var path = Path.Combine(docDir, clazz.Label + extension); File.WriteAllText(path, classDoc); } }