Exemplo n.º 1
0
        private SProcMap CreateStoredProcedureFiles(SqlSProcPublishSettings settings, EnvDTE.Project targetProject, string targetFolder, EnvDTE.ProjectItem targetProjectItem)
        {
            var g = new SProcScriptGenerator(_fs);

            var sprocFiles = targetProject.GetSProcFiles(_pss);
            var sprocMap   = g.CreateStoredProcedureScripts(settings, sprocFiles);

            foreach (var name in sprocMap)
            {
                var template = sprocMap[name];
                if (!string.IsNullOrEmpty(template))
                {
                    var sprocFile = Path.ChangeExtension(Path.Combine(targetFolder, name), ".sql");
                    _fs.WriteAllText(sprocFile, template);
                    targetProjectItem.ProjectItems.AddFromFile(sprocFile);
                }
            }
            return(sprocMap);
        }