Microsoft.VisualStudio.R.Package.Sql.Publish.SProcScriptGenerator.FillSprocInlineTemplate C# (CSharp) Method

FillSprocInlineTemplate() private method

Replaces procedure name, R Code and the SQL query placeholders with actual values
private FillSprocInlineTemplate ( string rFilePath, string sprocName ) : string
rFilePath string
sprocName string
return string
        private string FillSprocInlineTemplate(string rFilePath, string sprocName) {
            var sprocTemplateFile = rFilePath.ToSProcFilePath();
            var sprocTemplate = GetSqlFileContent(sprocTemplateFile);

            var rCode = GetRFileContent(rFilePath);
            rCode = rCode.EndsWithOrdinal(Environment.NewLine) ? rCode : rCode + Environment.NewLine;
            sprocTemplate = sprocTemplate.Replace(RCodeTemplate, Environment.NewLine + rCode);

            var sqlQuery = GetSqlFileContent(rFilePath.ToQueryFilePath()).Trim();
            return sprocTemplate.Replace(InputQueryTemplate, sqlQuery);
        }