/// <inheritdoc />.
        public void Write(ThriftFile thriftFile, string generatedCode)
        {
            var outputFile = new FileInfo(thriftFile.OutputPath);

            if (!outputFile.Directory.Exists)
            {
                outputFile.Directory.Create();
            }

            using var writer = new StreamWriter(outputFile.Create());
            writer.WriteLine(generatedCode);
        }
        /// <inheritdoc/>
        public string Generate(ThriftFile file, IDocument document)
        {
            var assembly    = typeof(ThriftDocumentGenerator).Assembly;
            var rawTemplate = assembly.GetManifestResourceStream(
                $"{assembly.GetName().Name}.Templates.csharp.stg");

            using var reader = new StreamReader(rawTemplate);
            var templateGroup = new TemplateGroupString(
                "csharp.stg",
                reader.ReadToEnd(),
                '$',
                '$');
            var template = templateGroup.GetInstanceOf("document");

            // TODO: Get the semantic version
            template.Add("version", assembly.GetName().Version.ToString())
            .Add("file", file)
            .Add("model", document)
            .Add("typeMap", ThriftTypeGenerationInfo.TypeMap);

            return(template.Render());
        }