static private string CleanMetadata(string csdlContents, Options options) { // Clean up EDMX to work with the generators assumptions. string processedCsdlContents = MetadataPreprocessor.CleanMetadata(csdlContents); // Create clean metadata and provide a path to it. string pathToCleanMetadata = FileWriter.WriteMetadata(processedCsdlContents, "cleanMetadata.xml"); // Inject documentation annotations into the CSDL using ApiDoctor and get back the file as a string. return(AnnotationHelper.ApplyAnnotationsToCsdl(options, pathToCleanMetadata).Result); }
/// <summary> /// Transform CSDL with XSLT and add documentation. /// </summary> /// <param name="csdlContents">The CSDL to transform.</param> /// <param name="options">The options bag that must contain the -transform -t parameter, /// and the -docs -d parameter.</param> static internal void TransformWithDocs(string csdlContents, Options options) { var pathToCleanMetadata = Transform(csdlContents, options); string csdlWithDocAnnotations = AnnotationHelper.ApplyAnnotationsToCsdl(options, pathToCleanMetadata).Result; string outputMetadataFilename = options.OutputMetadataFileName ?? "cleanMetadataWithDescriptions"; string metadataFileName = string.Concat(outputMetadataFilename, options.EndpointVersion, ".xml"); FileWriter.WriteMetadata(csdlWithDocAnnotations, metadataFileName, options.Output); Logger.Info($"Transformed metadata with documentation written to {metadataFileName}"); }