private static void Main(string[] args) { Options opts = ProcessOptions(args); IEnumerable<OntologyClass> classes = null; if (!string.IsNullOrEmpty(opts.EndpointUri) || !string.IsNullOrEmpty(opts.SourceFile)) { var mr = new MetadataRetriever(opts); classes = new List<OntologyClass>(mr.GetClasses()); } if (!string.IsNullOrEmpty(opts.GeneratedMetadataLocation) && classes != null) { var mw = new ModelWriter(); mw.Write(opts.GeneratedMetadataLocation, classes); } if (classes == null && !string.IsNullOrEmpty(opts.GeneratedMetadataLocation)) { var mw = new ModelWriter(); classes = mw.Read(opts.GeneratedMetadataLocation); } if (!string.IsNullOrEmpty(opts.GeneratedSourceLocation) && classes != null) { var cg = new CodeGenerator(); string code = cg.Generate(classes, opts); WriteSource(opts.GeneratedSourceLocation, code); } Console.WriteLine("done."); Console.Read(); }
private static void Main(string[] args) { Options opts = ProcessOptions(args); IEnumerable <OntologyClass> classes = null; if (!string.IsNullOrEmpty(opts.EndpointUri) || !string.IsNullOrEmpty(opts.SourceFile)) { var mr = new MetadataRetriever(opts); classes = new List <OntologyClass>(mr.GetClasses()); } if (!string.IsNullOrEmpty(opts.GeneratedMetadataLocation) && classes != null) { var mw = new ModelWriter(); mw.Write(opts.GeneratedMetadataLocation, classes); } if (classes == null && !string.IsNullOrEmpty(opts.GeneratedMetadataLocation)) { var mw = new ModelWriter(); classes = mw.Read(opts.GeneratedMetadataLocation); } if (!string.IsNullOrEmpty(opts.GeneratedSourceLocation) && classes != null) { var cg = new CodeGenerator(); string code = cg.Generate(classes, opts); WriteSource(opts.GeneratedSourceLocation, code); } Console.WriteLine("done."); Console.Read(); }