/// <summary> /// Applies annotations to CSDL file. /// </summary> /// <param name="options">The typewriter input options.</param> /// <param name="pathToCleanMetadata">Optional. Contains the path to a clean metadata to use when applying annotations. Overrides Option.Metadata.</param> /// <returns>An annotated metadata file.</returns> internal async static Task <string> ApplyAnnotationsToCsdl(Options options, string pathToCleanMetadata = null) { DocSet docs = GetDocSet(options, new IssueLogger()); var csdlWriterOptions = new CsdlWriterOptions() { DocumentationSetPath = options.DocsRoot + "\\api-reference\\v1.0\\", Annotations = AnnotationOptions.Properties, SkipMetadataGeneration = true, Formats = MetadataFormat.EdmxInput }; // We only intend to use the source metadata when we don't pass in a CSDL. if (string.IsNullOrEmpty(pathToCleanMetadata)) { csdlWriterOptions.SourceMetadataPath = options.Metadata; } else { csdlWriterOptions.SourceMetadataPath = pathToCleanMetadata; } DocAnnotationWriter docWriter = new DocAnnotationWriter(docs, csdlWriterOptions); return(await docWriter.PublishToStringAsync(new IssueLogger())); }
internal DocAnnotationWriter(DocSet docSet, CsdlWriterOptions options) : base(docSet, options) { this.options = options; // Can change the base access modifier so we could use it. }