AzurePoolCrossDbGenerator/Generators.cs
/// <summary>
/// Load the specified template contents from a file or exits if the template cannot be found.
/// </summary>
/// <returns></returns>
Load the specified template contents from a file or exits if the template cannot be found.
Load the specified template contents from a file or exits if the template cannot be found .
static string GetTemplateContents(string fileName)
        {
            string templateFolder = Path.Combine(Directory.GetCurrentDirectory(), Program.FileNames.TemplatesFolder);
            string templatePath = (Path.IsPathFullyQualified(fileName)) ? fileName : Path.Combine(templateFolder, fileName);
            if (!File.Exists(templatePath))
            {
                Program.WriteLine($"Template not found: {templatePath}", ConsoleColor.Red);
                Program.ExitApp();
            }
            string templateContents = File.ReadAllText(templatePath);
            return templateContents;
        }
static string GetTemplateContents ( string fileName ) { string templateFolder = Path . Combine ( Directory . GetCurrentDirectory ( ) , Program . FileNames . TemplatesFolder ) ; string templatePath = ( Path . IsPathFullyQualified ( fileName ) ) ? fileName : Path . Combine ( templateFolder , fileName ) ; if ( ! File . Exists ( templatePath ) ) { Program . WriteLine ( $" Template not found:  { templatePath } " , ConsoleColor . Red ) ; Program . ExitApp ( ) ; } string templateContents = File . ReadAllText ( templatePath ) ; return templateContents ; }
Load the specified template contents from a file or exits if the template cannot be found.
Load the specified template contents from a file or exits if the template cannot be found .
None
fileName
string