src/Elements/Generate/TypeGenerator.cs
/// <summary>
/// For a given schema, generate code, compile an assembly, and write it to disk at the specified path.
/// </summary>
/// <param name="schema"></param>
/// <param name="dllPath"></param>
/// <param name="diagnosticResults"></param>
/// <param name="frameworkBuild"></param>
/// <returns>Returns true if the dll was generated successfully, otherwise false.</returns>
For a given schema, generate code, compile an assembly, and write it to disk at the specified path.
For a given schema generate code compile an assembly and write it to disk at the specified path .
public static bool GenerateAndSaveDllForSchema(JsonSchema schema, string dllPath, out string[] diagnosticResults, bool frameworkBuild = false)
        {
            var csharp = GenerateCSharpCodeForSchema(schema);
            if (csharp == null)
            {
                diagnosticResults = new string[] { };
                return false;
            }
            var compilation = GenerateCompilation(new List<string> { csharp }, schema.Title, frameworkBuild);
            return EmitAndSave(compilation, dllPath, out diagnosticResults);
        }
public static bool GenerateAndSaveDllForSchema ( JsonSchema schema , string dllPath , out string [ ] diagnosticResults , bool frameworkBuild = false ) { var csharp = GenerateCSharpCodeForSchema ( schema ) ; if ( csharp == null ) { diagnosticResults = new string [ ] { } ; return false ; } var compilation = GenerateCompilation ( new List < string > { csharp } , schema . Title , frameworkBuild ) ; return EmitAndSave ( compilation , dllPath , out diagnosticResults ) ; }
For a given schema, generate code, compile an assembly, and write it to disk at the specified path.
For a given schema generate code compile an assembly and write it to disk at the specified path .
Returns true if the dll was generated successfully, otherwise false.
Returns true if the dll was generated successfully otherwise false .
schema
JsonSchema
None
dllPath
string
None
string[]
out
frameworkBuild
bool
None
diagnosticResults
None