static void Compile(Options options) { if (string.IsNullOrEmpty(options.SourceFile)) throw new CommandLineRequiredArgumentMissingException(typeof(Options), "SourceFile", -1); if (string.IsNullOrEmpty(options.ProjectFile)) throw new CommandLineRequiredArgumentMissingException(typeof(Options), "ProjectFile", -1); var augmentor = new SqlPublicationDacpacAugmentor(); var compiler = new SqlPublicationCompiler(); augmentor.Augment(options.SourceFile, compiler.Compile(options.ProjectFile, options.SourceFile)); }
public void Execute() { var compiler = new SqlPublicationCompiler(); var sourceSerializer = new XmlSerializer(typeof (Source.Publication)); var source = (Source.Publication) sourceSerializer.Deserialize(new FileStream(@"Samples\Source File.xml", FileMode.Open)); var model = new TSqlModel(@""); var output = compiler.Compile(new List<Source.Publication> { source }, model); var outputSerializer = new XmlSerializer(typeof(DataSchemaModel)); outputSerializer.Serialize(new FileStream(@"Samples\Compiled Model.xml", FileMode.Create), output); }