/// <summary>
        ///     Static method to return a Dictionary of JsonSchemaWrapper and its corresponding C# generated code.
        /// </summary>
        /// <param name="schemaLoc">Location of JSON schema.</param>
        /// <returns>A mapping of all the JSON schemas and the generated code.</returns>
        public static Dictionary <JsonSchemaWrapper, string> GenerateFromFile(string schemaLoc)
        {
            var controller = new JsonSchemaToPoco(
                new JsonSchemaToPocoConfiguration
            {
                JsonSchemaFileLocation = schemaLoc
            }
                );

            controller.LoadSchemas();
            return(controller.GenerateHelper());
        }
Ejemplo n.º 2
0
 /// <summary>
 ///     Static method to return a Dictionary of JsonSchemaWrapper and its corresponding C# generated code.
 /// </summary>
 /// <param name="schemaLoc">Location of JSON schema.</param>
 /// <returns>A mapping of all the JSON schemas and the generated code.</returns>
 public static Dictionary<JsonSchemaWrapper, string> GenerateFromFile(string schemaLoc)
 {
     var controller = new JsonSchemaToPoco(
         new JsonSchemaToPocoConfiguration
         {
             JsonSchemaFileLocation = schemaLoc
         }
     );
     controller.LoadSchemas();
     return controller.GenerateHelper();
 }
 /// <summary>
 ///     Constructor taking in command line arguments.
 /// </summary>
 /// <param name="args">Command line arguments.</param>
 public JsonSchemaToPocoCLExecutor(IEnumerable<string> args)
 {
     _settings = ConfigureCommandLineOptions(args);
     
     _controller = new JsonSchemaToPoco(_settings.Config);
 }