Esempio n. 1
0
        private void AddDeleteStoredProcedures(KDataStoreProject mDatabaseProject)
        {
            var deleteStoredProcedures = new List <KStoredProcedure>();

            foreach (var table in Enumerable.Reverse(mDatabaseProject.Table))
            {
                var converter3 = new CTableToSStoredProcedureDeleteConverter();

                var storedProcedure = converter3.Convert(table.GeneratedTable);

                deleteStoredProcedures.Add(new KStoredProcedure
                {
                    StoredProcedureName      = storedProcedure.StoredProcedureName,
                    ParameterSetName         = storedProcedure.ParameterSetName,
                    ResultSetName            = storedProcedure.ResultSetName,
                    GeneratedStoredProcedure = storedProcedure
                });
            }

            mDatabaseProject.StoredProcedure.AddRange(deleteStoredProcedures);
        }
        private void AddDeleteStoredProcedures(CProject dataProject, List <CTable> tables)
        {
            foreach (var table in Enumerable.Reverse(tables))
            {
                var converter3 = new CTableToSStoredProcedureDeleteConverter();

                var storedProcedure = converter3.Convert(table);


                var fileName = $"{storedProcedure.StoredProcedureName}.sql";
                //var filePath = System.IO.Path.Combine(System.IO.Path.Combine(OutputRootPath, dataProject.ProjectFolder), fileName);

                dataProject.ProjectContent.Add(new CProjectContent
                {
                    Content     = storedProcedure,
                    BuildAction = CBuildAction.Build,
                    File        = new CFile
                    {
                        Folder   = $"{storedProcedure.Schema.SchemaName}\\Stored Procedures",
                        FileName = fileName
                    }
                });
            }
        }