diff --git a/.github/dependabot.yml b/.github/dependabot.yml index ed3887c435..2e799fc800 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -17,3 +17,7 @@ updates: aws-sdk: patterns: - "AWSSDK.*" +- package-ecosystem: "dotnet-sdk" + directory: "/" + schedule: + interval: weekly diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0429f8d494..b26b4f3f09 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,6 +18,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 + - name: setup .NET + uses: actions/setup-dotnet@v4.2.0 - name: Populate Databases.yaml shell: bash run: | @@ -83,6 +85,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 + - name: setup .NET + uses: actions/setup-dotnet@v4.2.0 - name: Populate Databases.yaml shell: bash run: | @@ -149,12 +153,14 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 + - name: setup .NET + uses: actions/setup-dotnet@v4.2.0 - name: Determine RDMP build version id: version shell: bash run: perl -ne "print \"rdmpversion=\$1\n\" if /AssemblyInformationalVersion\(\"([0-9a-z.-]+)\"\)/;" SharedAssemblyInfo.cs >> $GITHUB_OUTPUT - name: Setup .NET Core - uses: actions/setup-dotnet@v4.1.0 + uses: actions/setup-dotnet@v4.2.0 with: dotnet-version: 7.0.x - name: BundleSource @@ -173,14 +179,14 @@ jobs: - name: Temporary Bundle of ddls for auto-updater shell: bash run: | - cp -r Application/ResearchDataManagementPlatform/bin/Release/net8.0-windows/win-x64/runtimes ./PublishWinForms - cp -r Application/ResearchDataManagementPlatform/bin/Release/net8.0-windows/win-x64/x64 ./PublishWinForms - cp Application/ResearchDataManagementPlatform/bin/Release/net8.0-windows/win-x64/D3DCompiler_47_cor3.dll ./PublishWinForms - cp Application/ResearchDataManagementPlatform/bin/Release/net8.0-windows/win-x64/PenImc_cor3.dll ./PublishWinForms - cp Application/ResearchDataManagementPlatform/bin/Release/net8.0-windows/win-x64/PresentationNative_cor3.dll ./PublishWinForms - cp Application/ResearchDataManagementPlatform/bin/Release/net8.0-windows/win-x64/vcruntime140_cor3.dll ./PublishWinForms - cp Application/ResearchDataManagementPlatform/bin/Release/net8.0-windows/win-x64/WebView2Loader.dll ./PublishWinForms - cp Application/ResearchDataManagementPlatform/bin/Release/net8.0-windows/win-x64/wpfgfx_cor3.dll ./PublishWinForms + cp -r Application/ResearchDataManagementPlatform/bin/Release/net9.0-windows/win-x64/runtimes ./PublishWinForms + cp -r Application/ResearchDataManagementPlatform/bin/Release/net9.0-windows/win-x64/x64 ./PublishWinForms + cp Application/ResearchDataManagementPlatform/bin/Release/net9.0-windows/win-x64/D3DCompiler_47_cor3.dll ./PublishWinForms + cp Application/ResearchDataManagementPlatform/bin/Release/net9.0-windows/win-x64/PenImc_cor3.dll ./PublishWinForms + cp Application/ResearchDataManagementPlatform/bin/Release/net9.0-windows/win-x64/PresentationNative_cor3.dll ./PublishWinForms + cp Application/ResearchDataManagementPlatform/bin/Release/net9.0-windows/win-x64/vcruntime140_cor3.dll ./PublishWinForms + cp Application/ResearchDataManagementPlatform/bin/Release/net9.0-windows/win-x64/WebView2Loader.dll ./PublishWinForms + cp Application/ResearchDataManagementPlatform/bin/Release/net9.0-windows/win-x64/wpfgfx_cor3.dll ./PublishWinForms - name: Install Plugins shell: bash run: | @@ -286,6 +292,8 @@ jobs: with: path: ${{ github.workspace }}/ key: ${{ github.sha }}-your-cache-key-bundled + - name: setup .NET + uses: actions/setup-dotnet@v4.2.0 - name: Determine RDMP build version id: version shell: bash diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 3f3fa860d4..eff78bfcba 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -25,6 +25,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + - name: setup .NET + uses: actions/setup-dotnet@v4.2.0 - name: Initialize CodeQL uses: github/codeql-action/init@v3 diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 5625ce13db..701d02a5bc 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -17,7 +17,7 @@ jobs: with: submodules: true - name: Setup .NET Core - uses: actions/setup-dotnet@v4.1.0 + uses: actions/setup-dotnet@v4.2.0 with: dotnet-version: 6.0.x - name: Cache Nuget diff --git a/Application/ResearchDataManagementPlatform/RDMPMainForm.cs b/Application/ResearchDataManagementPlatform/RDMPMainForm.cs index a382c426fa..f181cbefa5 100644 --- a/Application/ResearchDataManagementPlatform/RDMPMainForm.cs +++ b/Application/ResearchDataManagementPlatform/RDMPMainForm.cs @@ -5,6 +5,7 @@ // You should have received a copy of the GNU General Public License along with RDMP. If not, see . using System; +using System.ComponentModel; using System.Drawing; using System.IO; using System.Linq; @@ -81,7 +82,7 @@ public RDMPMainForm() WindowState = FormWindowState.Maximized; CloseOnEscape = false; - if (UserSettings.LicenseAccepted != new License("LIBRARYLICENSES").GetHashOfLicense()) + if (UserSettings.LicenseAccepted != new WindowManagement.Licenses.License("LIBRARYLICENSES").GetHashOfLicense()) new LicenseUI().ShowDialog(); } @@ -163,6 +164,7 @@ private void RDMPMainForm_Load(object sender, EventArgs e) Loading = false; } + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public override string Text { get => base.Text; diff --git a/Application/ResearchDataManagementPlatform/ResearchDataManagementPlatform.csproj b/Application/ResearchDataManagementPlatform/ResearchDataManagementPlatform.csproj index bda4470b9b..8740a1585d 100644 --- a/Application/ResearchDataManagementPlatform/ResearchDataManagementPlatform.csproj +++ b/Application/ResearchDataManagementPlatform/ResearchDataManagementPlatform.csproj @@ -2,7 +2,7 @@ {550988FD-F1FA-41D8-BE0F-00B4DE47D320} WinExe - net8.0-windows + $(TargetFramework)-windows true true true diff --git a/Application/ResearchDataManagementPlatform/Theme/Themes.cs b/Application/ResearchDataManagementPlatform/Theme/Themes.cs index 7708d2abf3..d3eb79580e 100644 --- a/Application/ResearchDataManagementPlatform/Theme/Themes.cs +++ b/Application/ResearchDataManagementPlatform/Theme/Themes.cs @@ -4,6 +4,7 @@ // RDMP is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. // You should have received a copy of the GNU General Public License along with RDMP. If not, see . +using System.ComponentModel; using System.Globalization; using System.Windows.Forms; using Rdmp.UI.Theme; @@ -16,6 +17,8 @@ namespace ResearchDataManagementPlatform.Theme; public class MyVS2015BlueTheme : VS2015BlueTheme, ITheme { private ThemeExtender _extender; + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public bool ApplyThemeToMenus { get; set; } public MyVS2015BlueTheme() @@ -40,6 +43,8 @@ public MyVS2015BlueTheme() public class MyVS2015DarkTheme : VS2015DarkTheme, ITheme { private ThemeExtender _extender; + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public bool ApplyThemeToMenus { get; set; } public MyVS2015DarkTheme() @@ -64,6 +69,8 @@ public MyVS2015DarkTheme() public class MyVS2015LightTheme : VS2015LightTheme, ITheme { private ThemeExtender _extender; + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public bool ApplyThemeToMenus { get; set; } public MyVS2015LightTheme() diff --git a/Application/ResearchDataManagementPlatform/WindowManagement/ContentWindowTracking/Persistence/PersistableSingleDatabaseObjectDockContent.cs b/Application/ResearchDataManagementPlatform/WindowManagement/ContentWindowTracking/Persistence/PersistableSingleDatabaseObjectDockContent.cs index 70f7888bc1..912abda634 100644 --- a/Application/ResearchDataManagementPlatform/WindowManagement/ContentWindowTracking/Persistence/PersistableSingleDatabaseObjectDockContent.cs +++ b/Application/ResearchDataManagementPlatform/WindowManagement/ContentWindowTracking/Persistence/PersistableSingleDatabaseObjectDockContent.cs @@ -4,6 +4,7 @@ // RDMP is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. // You should have received a copy of the GNU General Public License along with RDMP. If not, see . +using System.ComponentModel; using System.Windows.Forms; using Rdmp.Core.CommandExecution; using Rdmp.Core.Curation.Data; @@ -28,6 +29,7 @@ namespace ResearchDataManagementPlatform.WindowManagement.ContentWindowTracking. [TechnicalUI] public class PersistableSingleDatabaseObjectDockContent : RDMPSingleControlTab { + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public IMapsDirectlyToDatabaseTable DatabaseObject { get; private set; } public const string Prefix = "RDMPSingleDatabaseObjectControl"; diff --git a/Application/ResearchDataManagementPlatform/WindowManagement/ContentWindowTracking/Persistence/RDMPSingleControlTab.cs b/Application/ResearchDataManagementPlatform/WindowManagement/ContentWindowTracking/Persistence/RDMPSingleControlTab.cs index 87ec6121dc..d588b61694 100644 --- a/Application/ResearchDataManagementPlatform/WindowManagement/ContentWindowTracking/Persistence/RDMPSingleControlTab.cs +++ b/Application/ResearchDataManagementPlatform/WindowManagement/ContentWindowTracking/Persistence/RDMPSingleControlTab.cs @@ -5,6 +5,7 @@ // You should have received a copy of the GNU General Public License along with RDMP. If not, see . using System; +using System.ComponentModel; using System.Text; using System.Windows.Forms; using Rdmp.Core.Curation.Data.Dashboarding; @@ -26,6 +27,7 @@ public class RDMPSingleControlTab : DockContent, IRefreshBusSubscriber /// /// The control hosted on this tab /// + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public Control Control { get; protected set; } public const string BasicPrefix = "BASIC"; diff --git a/CHANGELOG.md b/CHANGELOG.md index 859f5d9afc..3c4410727d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,15 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +- Build on and target .Net 9 rather than 8 +- Simplify DB Patching Interface + +## [8.4.2] - 2024-12-18 + +- Fix issue with MEF constructing Remote Table Attachers + ## [8.4.1] - 2024-12-10 - Improve Overview Model Generation Speed diff --git a/Directory.Build.props b/Directory.Build.props index 74fe3865f0..c944ba5fb9 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,7 +1,8 @@ - - 11.0 - 8.4.0 + + net9.0 + latest true - + NU1902;NU1903;NU1904;1701;1702;CS1591;NU1701;CA1416 + diff --git a/Directory.Packages.props b/Directory.Packages.props index fe5f1a894c..ffc9d4b8e4 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -1,9 +1,9 @@ - - - - + + + + @@ -16,8 +16,8 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + @@ -27,13 +27,13 @@ - + - + @@ -41,9 +41,9 @@ - + - + \ No newline at end of file diff --git a/Rdmp.Core.Tests/CommandExecution/ExecuteCommandUpdateCatalogueDataLocationTests.cs b/Rdmp.Core.Tests/CommandExecution/ExecuteCommandUpdateCatalogueDataLocationTests.cs index ee6b3e2691..5f448b810e 100644 --- a/Rdmp.Core.Tests/CommandExecution/ExecuteCommandUpdateCatalogueDataLocationTests.cs +++ b/Rdmp.Core.Tests/CommandExecution/ExecuteCommandUpdateCatalogueDataLocationTests.cs @@ -68,22 +68,22 @@ private void CreateCatalogue() if (CatalogueRepository.GetAllObjects().Length == 0) creator.CreatePipelines(new PlatformDatabaseCreationOptions()); - var pipe = CatalogueRepository.GetAllObjects().OrderByDescending(p => p.ID) - .FirstOrDefault(p => p.Name.Contains("BULK INSERT: CSV Import File (automated column-type detection)")); + var pipe = CatalogueRepository.GetAllObjects().OrderByDescending(static p => p.ID) + .FirstOrDefault(static p => p.Name.Contains("BULK INSERT: CSV Import File (automated column-type detection)")); var cmd = new ExecuteCommandCreateNewCatalogueByImportingFile(new ThrowImmediatelyActivator(RepositoryLocator), info, "Column1", db, pipe, null); cmd.Execute(); originalTableInfoID = RepositoryLocator.CatalogueRepository.GetAllObjects().First().ColumnInfo .TableInfo_ID; - var column1 = RepositoryLocator.CatalogueRepository.GetAllObjects() - .Where(c => c.Name == "Column1").First(); - column1.ExtractionInformation.SelectSQL = column1.ExtractionInformation.SelectSQL + " as SOME_ALIAS"; + var column1 = RepositoryLocator.CatalogueRepository + .GetAllObjects().First(static c => c.Name == "Column1"); + column1.ExtractionInformation.SelectSQL += " as SOME_ALIAS"; column1.ExtractionInformation.SaveToDatabase(); } private void CreateSecondaryCatalogue() { - var fileName = Path.GetTempPath() + Guid.NewGuid() + ".csv"; + var fileName = $"{Path.GetTempPath()}{Guid.NewGuid()}.csv"; using (var outputFile = new StreamWriter(fileName, true)) { outputFile.WriteLine("Column,Other"); @@ -149,8 +149,8 @@ public void UpdateLocationColumnBadType() [Test] public void UpdateLocationCheckOK() { - goodCatalogueID = RepositoryLocator.CatalogueRepository.GetAllObjects() - .Where(c => c.Name == "Column2").First().Catalogue_ID; + goodCatalogueID = RepositoryLocator.CatalogueRepository + .GetAllObjects().First(static c => c.Name == "Column2").Catalogue_ID; var cmd = new ExecuteCommandUpdateCatalogueDataLocation(new ThrowImmediatelyActivator(RepositoryLocator), RepositoryLocator.CatalogueRepository.GetAllObjects() .Where(c => c.Catalogue_ID == goodCatalogueID).ToArray(), RemoteTable, null); @@ -171,47 +171,53 @@ public void UpdateLocationExecuteNoCheck_Bad() [Test] public void UpdateLocationExecuteNoCheck_OK() { - goodCatalogueID = RepositoryLocator.CatalogueRepository.GetAllObjects() - .Where(c => c.Name == "Column2").First().Catalogue_ID; + goodCatalogueID = RepositoryLocator.CatalogueRepository + .GetAllObjects().First(static c => c.Name == "Column2").Catalogue_ID; var cmd = new ExecuteCommandUpdateCatalogueDataLocation(new ThrowImmediatelyActivator(RepositoryLocator), RepositoryLocator.CatalogueRepository.GetAllObjects() .Where(c => c.Catalogue_ID == goodCatalogueID).ToArray(), RemoteTable, null); Assert.DoesNotThrow(() => cmd.Execute()); - var ci = RepositoryLocator.CatalogueRepository.GetAllObjects() - .Where(c => c.Name == "Column2" && c.Catalogue_ID == goodCatalogueID).First(); - Assert.That(ci.ColumnInfo.Name, Is.EqualTo(RemoteTable.GetFullyQualifiedName() + ".[Column2]")); - Assert.That(ci.ExtractionInformation.SelectSQL, Is.EqualTo(RemoteTable.GetFullyQualifiedName() + ".[Column2]")); - Assert.That(ci.ColumnInfo.TableInfo_ID, Is.Not.EqualTo(originalTableInfoID)); + var ci = RepositoryLocator.CatalogueRepository + .GetAllObjects().First(c => c.Name == "Column2" && c.Catalogue_ID == goodCatalogueID); + Assert.Multiple(() => + { + Assert.That(ci.ColumnInfo.Name, Is.EqualTo($"{RemoteTable.GetFullyQualifiedName()}.[Column2]")); + Assert.That(ci.ExtractionInformation.SelectSQL, Is.EqualTo($"{RemoteTable.GetFullyQualifiedName()}.[Column2]")); + Assert.That(ci.ColumnInfo.TableInfo_ID, Is.Not.EqualTo(originalTableInfoID)); + }); } [Test] public void UpdateLocationExecuteNoCheck_AliasCheck() { - goodCatalogueID = RepositoryLocator.CatalogueRepository.GetAllObjects() - .Where(c => c.Name == "Column2").First().Catalogue_ID; + goodCatalogueID = RepositoryLocator.CatalogueRepository + .GetAllObjects().First(static c => c.Name == "Column2").Catalogue_ID; var cmd = new ExecuteCommandUpdateCatalogueDataLocation(new ThrowImmediatelyActivator(RepositoryLocator), RepositoryLocator.CatalogueRepository.GetAllObjects() .Where(c => c.Catalogue_ID == goodCatalogueID).ToArray(), RemoteTable, null); Assert.DoesNotThrow(() => cmd.Execute()); - var ci = RepositoryLocator.CatalogueRepository.GetAllObjects() - .Where(c => c.Name == "Column1" && c.Catalogue_ID == goodCatalogueID).First(); + var ci = RepositoryLocator.CatalogueRepository + .GetAllObjects().First(c => c.Name == "Column1" && c.Catalogue_ID == goodCatalogueID); Assert.That(ci.ColumnInfo.Name, Is.EqualTo(RemoteTable.GetFullyQualifiedName() + ".[Column1]")); - var ei = RepositoryLocator.CatalogueRepository.GetAllObjects() - .Where(e => e.ID == ci.ExtractionInformation.ID).First(); - Assert.That(ei.SelectSQL, Is.EqualTo(RemoteTable.GetFullyQualifiedName() + ".[Column1] as SOME_ALIAS")); - Assert.That(ci.ColumnInfo.TableInfo_ID, Is.Not.EqualTo(originalTableInfoID)); + var ei = RepositoryLocator.CatalogueRepository + .GetAllObjects().First(e => e.ID == ci.ExtractionInformation.ID); + Assert.Multiple(() => + { + Assert.That(ei.SelectSQL, Is.EqualTo(RemoteTable.GetFullyQualifiedName() + ".[Column1] as SOME_ALIAS")); + Assert.That(ci.ColumnInfo.TableInfo_ID, Is.Not.EqualTo(originalTableInfoID)); + }); } [Test] public void UpdateLocationWithMultipleExtractionIdentifiers() { - goodCatalogueID = RepositoryLocator.CatalogueRepository.GetAllObjects() - .Where(c => c.Name == "Column2").First().Catalogue_ID; - var ci = RepositoryLocator.CatalogueRepository.GetAllObjects() - .Where(c => c.Name == "Column2" && c.Catalogue_ID == goodCatalogueID).First(); + goodCatalogueID = RepositoryLocator.CatalogueRepository + .GetAllObjects().First(static c => c.Name == "Column2").Catalogue_ID; + var ci = RepositoryLocator.CatalogueRepository + .GetAllObjects().First(c => c.Name == "Column2" && c.Catalogue_ID == goodCatalogueID); - var otherci = RepositoryLocator.CatalogueRepository.GetAllObjects() - .Where(c => c.Name == "Column").First(); + var otherci = RepositoryLocator.CatalogueRepository + .GetAllObjects().First(static c => c.Name == "Column"); var cmd1 = new ExecuteCommandAddNewCatalogueItem(new ThrowImmediatelyActivator(RepositoryLocator), ci.Catalogue, new List { otherci.ColumnInfo }.ToArray()); Assert.DoesNotThrow(() => cmd1.Execute()); @@ -221,9 +227,12 @@ public void UpdateLocationWithMultipleExtractionIdentifiers() .Where(c => c.Catalogue_ID == goodCatalogueID && c.Name == "Column2").ToArray(), RemoteTable, null); Assert.DoesNotThrow(() => cmd.Execute()); Assert.That(ci.ColumnInfo.Name, Is.EqualTo(RemoteTable.GetFullyQualifiedName() + ".[Column2]")); - var ei = RepositoryLocator.CatalogueRepository.GetAllObjects() - .Where(e => e.ID == ci.ExtractionInformation.ID).First(); - Assert.That(ei.SelectSQL, Is.EqualTo(RemoteTable.GetFullyQualifiedName() + ".[Column2]")); - Assert.That(ci.ColumnInfo.TableInfo_ID, Is.Not.EqualTo(originalTableInfoID)); + var ei = RepositoryLocator.CatalogueRepository + .GetAllObjects().First(e => e.ID == ci.ExtractionInformation.ID); + Assert.Multiple(() => + { + Assert.That(ei.SelectSQL, Is.EqualTo($"{RemoteTable.GetFullyQualifiedName()}.[Column2]")); + Assert.That(ci.ColumnInfo.TableInfo_ID, Is.Not.EqualTo(originalTableInfoID)); + }); } } \ No newline at end of file diff --git a/Rdmp.Core.Tests/DataExport/DataExtraction/ExecuteFullExtractionToDatabaseMSSqlDestinationReExtractionTest.cs b/Rdmp.Core.Tests/DataExport/DataExtraction/ExecuteFullExtractionToDatabaseMSSqlDestinationReExtractionTest.cs index 5edb4639ae..df28b536ba 100644 --- a/Rdmp.Core.Tests/DataExport/DataExtraction/ExecuteFullExtractionToDatabaseMSSqlDestinationReExtractionTest.cs +++ b/Rdmp.Core.Tests/DataExport/DataExtraction/ExecuteFullExtractionToDatabaseMSSqlDestinationReExtractionTest.cs @@ -82,19 +82,19 @@ public void ReExtractToADatabaseWithNoNewData() null, db, pipe, null); cmd.Execute(); - var catalogue = CatalogueRepository.GetAllObjects().Where(c => c.Name == "bob").FirstOrDefault(); - var chiColumnInfo = catalogue.CatalogueItems.Where(ci => ci.Name == "chi").First(); + var catalogue = CatalogueRepository.GetAllObjects().FirstOrDefault(static c => c.Name == "bob"); + var chiColumnInfo = catalogue.CatalogueItems.First(static ci => ci.Name == "chi"); var ei = chiColumnInfo.ExtractionInformation; ei.IsExtractionIdentifier = true; ei.IsPrimaryKey = true; ei.SaveToDatabase(); var project = new Project(DataExportRepository, "MyProject") { - ProjectNumber = 500 + ProjectNumber = 500, + ExtractionDirectory = Path.GetTempPath() }; - project.ExtractionDirectory = Path.GetTempPath(); project.SaveToDatabase(); - CohortIdentificationConfiguration cic = new CohortIdentificationConfiguration(CatalogueRepository, "Cohort1"); + var cic = new CohortIdentificationConfiguration(CatalogueRepository, "Cohort1"); cic.CreateRootContainerIfNotExists(); var agg1 = new AggregateConfiguration(CatalogueRepository, catalogue, "agg1"); var conf = new AggregateConfiguration(CatalogueRepository, catalogue, "UnitTestShortcutAggregate"); @@ -106,13 +106,13 @@ public void ReExtractToADatabaseWithNoNewData() dim.SaveToDatabase(); agg1.SaveToDatabase(); - string CohortDatabaseName = TestDatabaseNames.GetConsistentName("CohortDatabase"); - string cohortTableName = "Cohort"; - string definitionTableName = "CohortDefinition"; - string ExternalCohortTableNameInCatalogue = "CohortTests"; + var CohortDatabaseName = TestDatabaseNames.GetConsistentName("CohortDatabase"); + var cohortTableName = "Cohort"; + var definitionTableName = "CohortDefinition"; + var ExternalCohortTableNameInCatalogue = "CohortTests"; const string ReleaseIdentifierFieldName = "ReleaseId"; const string DefinitionTableForeignKeyField = "cohortDefinition_id"; - DiscoveredDatabase _cohortDatabase = DiscoveredServerICanCreateRandomDatabasesAndTablesOn.ExpectDatabase(CohortDatabaseName); + var _cohortDatabase = DiscoveredServerICanCreateRandomDatabasesAndTablesOn.ExpectDatabase(CohortDatabaseName); if (_cohortDatabase.Exists()) DeleteTables(_cohortDatabase); else @@ -166,7 +166,7 @@ public void ReExtractToADatabaseWithNoNewData() }; newExternal.SaveToDatabase(); - var cohortPipeline = CatalogueRepository.GetAllObjects().Where(p => p.Name == "CREATE COHORT:By Executing Cohort Identification Configuration").First(); + var cohortPipeline = CatalogueRepository.GetAllObjects().First(static p => p.Name == "CREATE COHORT:By Executing Cohort Identification Configuration"); var newCohortCmd = new ExecuteCommandCreateNewCohortByExecutingACohortIdentificationConfiguration( new ThrowImmediatelyActivator(RepositoryLocator), cic, @@ -174,14 +174,14 @@ public void ReExtractToADatabaseWithNoNewData() "MyCohort", project, cohortPipeline - ); + ); newCohortCmd.Execute(); - ExtractableCohort _extractableCohort = new ExtractableCohort(DataExportRepository, newExternal, 1); + var extractableCohort = new ExtractableCohort(DataExportRepository, newExternal, 1); var ec = new ExtractionConfiguration(DataExportRepository, project) { Name = "ext1", - Cohort_ID = _extractableCohort.ID + Cohort_ID = extractableCohort.ID }; ec.AddDatasetToConfiguration(new ExtractableDataSet(DataExportRepository, catalogue)); @@ -197,7 +197,7 @@ public void ReExtractToADatabaseWithNoNewData() var argumentTblNamePattern = destinationArguments.Single(a => a.Name == "TableNamingPattern"); var reExtract = destinationArguments.Single(a => a.Name == "AppendDataIfTableExists"); Assert.That(argumentServer.Name, Is.EqualTo("TargetDatabaseServer")); - ExternalDatabaseServer _extractionServer = new ExternalDatabaseServer(CatalogueRepository, "myserver", null) + var _extractionServer = new ExternalDatabaseServer(CatalogueRepository, "myserver", null) { Server = DiscoveredServerICanCreateRandomDatabasesAndTablesOn.Name, Username = DiscoveredServerICanCreateRandomDatabasesAndTablesOn.ExplicitUsernameIfAny, @@ -309,19 +309,19 @@ public void ReExtractToADatabaseWithNewDataAndNoPKs() null, db, pipe, null); cmd.Execute(); - var catalogue = CatalogueRepository.GetAllObjects().Where(c => c.Name == "bob").FirstOrDefault(); - var chiColumnInfo = catalogue.CatalogueItems.Where(ci => ci.Name == "chi").First(); + var catalogue = CatalogueRepository.GetAllObjects().FirstOrDefault(static c => c.Name == "bob"); + var chiColumnInfo = catalogue.CatalogueItems.First(static ci => ci.Name == "chi"); var ei = chiColumnInfo.ExtractionInformation; ei.IsExtractionIdentifier = true; ei.IsPrimaryKey = true; ei.SaveToDatabase(); var project = new Project(DataExportRepository, "MyProject") { - ProjectNumber = 500 + ProjectNumber = 500, + ExtractionDirectory = Path.GetTempPath() }; - project.ExtractionDirectory = Path.GetTempPath(); project.SaveToDatabase(); - CohortIdentificationConfiguration cic = new CohortIdentificationConfiguration(CatalogueRepository, "Cohort1"); + var cic = new CohortIdentificationConfiguration(CatalogueRepository, "Cohort1"); cic.CreateRootContainerIfNotExists(); var agg1 = new AggregateConfiguration(CatalogueRepository, catalogue, "agg1"); var conf = new AggregateConfiguration(CatalogueRepository, catalogue, "UnitTestShortcutAggregate"); @@ -333,13 +333,13 @@ public void ReExtractToADatabaseWithNewDataAndNoPKs() dim.SaveToDatabase(); agg1.SaveToDatabase(); - string CohortDatabaseName = TestDatabaseNames.GetConsistentName("CohortDatabase"); - string cohortTableName = "Cohort"; - string definitionTableName = "CohortDefinition"; - string ExternalCohortTableNameInCatalogue = "CohortTests"; + var CohortDatabaseName = TestDatabaseNames.GetConsistentName("CohortDatabase"); + var cohortTableName = "Cohort"; + var definitionTableName = "CohortDefinition"; + var ExternalCohortTableNameInCatalogue = "CohortTests"; const string ReleaseIdentifierFieldName = "ReleaseId"; const string DefinitionTableForeignKeyField = "cohortDefinition_id"; - DiscoveredDatabase _cohortDatabase = DiscoveredServerICanCreateRandomDatabasesAndTablesOn.ExpectDatabase(CohortDatabaseName); + var _cohortDatabase = DiscoveredServerICanCreateRandomDatabasesAndTablesOn.ExpectDatabase(CohortDatabaseName); if (_cohortDatabase.Exists()) DeleteTables(_cohortDatabase); else @@ -392,7 +392,7 @@ public void ReExtractToADatabaseWithNewDataAndNoPKs() }; newExternal.SaveToDatabase(); - var cohortPipeline = CatalogueRepository.GetAllObjects().Where(p => p.Name == "CREATE COHORT:By Executing Cohort Identification Configuration").First(); + var cohortPipeline = CatalogueRepository.GetAllObjects().First(static p => p.Name == "CREATE COHORT:By Executing Cohort Identification Configuration"); var newCohortCmd = new ExecuteCommandCreateNewCohortByExecutingACohortIdentificationConfiguration( new ThrowImmediatelyActivator(RepositoryLocator), cic, @@ -400,14 +400,14 @@ public void ReExtractToADatabaseWithNewDataAndNoPKs() "MyCohort", project, cohortPipeline - ); + ); newCohortCmd.Execute(); - ExtractableCohort _extractableCohort = new ExtractableCohort(DataExportRepository, newExternal, 1); + var extractableCohort = new ExtractableCohort(DataExportRepository, newExternal, 1); var ec = new ExtractionConfiguration(DataExportRepository, project) { Name = "ext1", - Cohort_ID = _extractableCohort.ID + Cohort_ID = extractableCohort.ID }; ec.AddDatasetToConfiguration(new ExtractableDataSet(DataExportRepository, catalogue)); @@ -423,7 +423,7 @@ public void ReExtractToADatabaseWithNewDataAndNoPKs() var argumentTblNamePattern = destinationArguments.Single(a => a.Name == "TableNamingPattern"); var reExtract = destinationArguments.Single(a => a.Name == "AppendDataIfTableExists"); Assert.That(argumentServer.Name, Is.EqualTo("TargetDatabaseServer")); - ExternalDatabaseServer _extractionServer = new ExternalDatabaseServer(CatalogueRepository, "myserver", null) + var _extractionServer = new ExternalDatabaseServer(CatalogueRepository, "myserver", null) { Server = DiscoveredServerICanCreateRandomDatabasesAndTablesOn.Name, Username = DiscoveredServerICanCreateRandomDatabasesAndTablesOn.ExplicitUsernameIfAny, @@ -486,17 +486,17 @@ public void ReExtractToADatabaseWithNewDataAndNoPKs() //add new entry here var tbl = db.DiscoverTables(false).First(); tbl.Insert(new Dictionary - { - { "chi","1111111111"}, - {"notes","T"}, - {"dtCreated", new DateTime(2001, 1, 2) }, - {"century",19}, - {"surname","1234"}, - {"forename","yes"}, - {"sex","M"}, - }); + { + { "chi","1111111111"}, + {"notes","T"}, + {"dtCreated", new DateTime(2001, 1, 2) }, + {"century",19}, + {"surname","1234"}, + {"forename","yes"}, + {"sex","M"}, + }); - CohortIdentificationConfiguration cic2 = new CohortIdentificationConfiguration(CatalogueRepository, "Cohort1"); + var cic2 = new CohortIdentificationConfiguration(CatalogueRepository, "Cohort1"); cic2.CreateRootContainerIfNotExists(); var agg12 = new AggregateConfiguration(CatalogueRepository, catalogue, "agg1"); _ = new AggregateConfiguration(CatalogueRepository, catalogue, "UnitTestShortcutAggregate"); @@ -509,7 +509,7 @@ public void ReExtractToADatabaseWithNewDataAndNoPKs() agg12.SaveToDatabase(); newCohortCmd.Execute(); - ExtractableCohort _extractableCohort2 = new ExtractableCohort(DataExportRepository, newExternal, 2); + var _extractableCohort2 = new ExtractableCohort(DataExportRepository, newExternal, 2); ec.Cohort_ID = _extractableCohort2.ID; ec.SaveToDatabase(); @@ -566,24 +566,24 @@ public void ReExtractToADatabaseWithNewDataAndSinglePK() null, db, pipe, null); cmd.Execute(); - var catalogue = CatalogueRepository.GetAllObjects().Where(c => c.Name == "bob").FirstOrDefault(); - var chiColumnInfo = catalogue.CatalogueItems.Where(ci => ci.Name == "chi").First(); + var catalogue = CatalogueRepository.GetAllObjects().FirstOrDefault(static c => c.Name == "bob"); + var chiColumnInfo = catalogue.CatalogueItems.First(static ci => ci.Name == "chi"); var ei = chiColumnInfo.ExtractionInformation; ei.IsExtractionIdentifier = true; ei.IsPrimaryKey = true; ei.SaveToDatabase(); - var surnameInfo = catalogue.CatalogueItems.Where(ci => ci.Name == "surname").First(); + var surnameInfo = catalogue.CatalogueItems.First(static ci => ci.Name == "surname"); surnameInfo.ExtractionInformation.IsPrimaryKey = true; surnameInfo.ExtractionInformation.SaveToDatabase(); var project = new Project(DataExportRepository, "MyProject") { - ProjectNumber = 500 + ProjectNumber = 500, + ExtractionDirectory = Path.GetTempPath() }; - project.ExtractionDirectory = Path.GetTempPath(); project.SaveToDatabase(); - CohortIdentificationConfiguration cic = new CohortIdentificationConfiguration(CatalogueRepository, "Cohort1"); + var cic = new CohortIdentificationConfiguration(CatalogueRepository, "Cohort1"); cic.CreateRootContainerIfNotExists(); var agg1 = new AggregateConfiguration(CatalogueRepository, catalogue, "agg1"); var conf = new AggregateConfiguration(CatalogueRepository, catalogue, "UnitTestShortcutAggregate"); @@ -595,13 +595,13 @@ public void ReExtractToADatabaseWithNewDataAndSinglePK() dim.SaveToDatabase(); agg1.SaveToDatabase(); - string CohortDatabaseName = TestDatabaseNames.GetConsistentName("CohortDatabase"); - string cohortTableName = "Cohort"; - string definitionTableName = "CohortDefinition"; - string ExternalCohortTableNameInCatalogue = "CohortTests"; + var CohortDatabaseName = TestDatabaseNames.GetConsistentName("CohortDatabase"); + var cohortTableName = "Cohort"; + var definitionTableName = "CohortDefinition"; + var ExternalCohortTableNameInCatalogue = "CohortTests"; const string ReleaseIdentifierFieldName = "ReleaseId"; const string DefinitionTableForeignKeyField = "cohortDefinition_id"; - DiscoveredDatabase _cohortDatabase = DiscoveredServerICanCreateRandomDatabasesAndTablesOn.ExpectDatabase(CohortDatabaseName); + var _cohortDatabase = DiscoveredServerICanCreateRandomDatabasesAndTablesOn.ExpectDatabase(CohortDatabaseName); if (_cohortDatabase.Exists()) DeleteTables(_cohortDatabase); else @@ -654,7 +654,7 @@ public void ReExtractToADatabaseWithNewDataAndSinglePK() }; newExternal.SaveToDatabase(); - var cohortPipeline = CatalogueRepository.GetAllObjects().Where(p => p.Name == "CREATE COHORT:By Executing Cohort Identification Configuration").First(); + var cohortPipeline = CatalogueRepository.GetAllObjects().First(static p => p.Name == "CREATE COHORT:By Executing Cohort Identification Configuration"); var newCohortCmd = new ExecuteCommandCreateNewCohortByExecutingACohortIdentificationConfiguration( new ThrowImmediatelyActivator(RepositoryLocator), cic, @@ -662,14 +662,14 @@ public void ReExtractToADatabaseWithNewDataAndSinglePK() "MyCohort", project, cohortPipeline - ); + ); newCohortCmd.Execute(); - ExtractableCohort _extractableCohort = new ExtractableCohort(DataExportRepository, newExternal, 1); + var extractableCohort = new ExtractableCohort(DataExportRepository, newExternal, 1); var ec = new ExtractionConfiguration(DataExportRepository, project) { Name = "ext1", - Cohort_ID = _extractableCohort.ID + Cohort_ID = extractableCohort.ID }; ec.AddDatasetToConfiguration(new ExtractableDataSet(DataExportRepository, catalogue)); @@ -685,7 +685,7 @@ public void ReExtractToADatabaseWithNewDataAndSinglePK() var argumentTblNamePattern = destinationArguments.Single(a => a.Name == "TableNamingPattern"); var reExtract = destinationArguments.Single(a => a.Name == "AppendDataIfTableExists"); Assert.That(argumentServer.Name, Is.EqualTo("TargetDatabaseServer")); - ExternalDatabaseServer _extractionServer = new ExternalDatabaseServer(CatalogueRepository, "myserver", null) + var _extractionServer = new ExternalDatabaseServer(CatalogueRepository, "myserver", null) { Server = DiscoveredServerICanCreateRandomDatabasesAndTablesOn.Name, Username = DiscoveredServerICanCreateRandomDatabasesAndTablesOn.ExplicitUsernameIfAny, @@ -748,17 +748,17 @@ public void ReExtractToADatabaseWithNewDataAndSinglePK() //add new entry here var tbl = db.DiscoverTables(false).First(); tbl.Insert(new Dictionary - { - { "chi","1111111111"}, - {"notes","T"}, - {"dtCreated", new DateTime(2001, 1, 2) }, - {"century",19}, - {"surname","1234"}, - {"forename","yes"}, - {"sex","M"}, - }); + { + { "chi","1111111111"}, + {"notes","T"}, + {"dtCreated", new DateTime(2001, 1, 2) }, + {"century",19}, + {"surname","1234"}, + {"forename","yes"}, + {"sex","M"}, + }); - CohortIdentificationConfiguration cic2 = new CohortIdentificationConfiguration(CatalogueRepository, "Cohort1"); + var cic2 = new CohortIdentificationConfiguration(CatalogueRepository, "Cohort1"); cic2.CreateRootContainerIfNotExists(); var agg12 = new AggregateConfiguration(CatalogueRepository, catalogue, "agg1"); _ = new AggregateConfiguration(CatalogueRepository, catalogue, "UnitTestShortcutAggregate"); @@ -770,15 +770,15 @@ public void ReExtractToADatabaseWithNewDataAndSinglePK() dim2.SaveToDatabase(); agg12.SaveToDatabase(); newCohortCmd = new ExecuteCommandCreateNewCohortByExecutingACohortIdentificationConfiguration( - new ThrowImmediatelyActivator(RepositoryLocator), - cic2, - newExternal, - "MyCohort", - project, - cohortPipeline - ); + new ThrowImmediatelyActivator(RepositoryLocator), + cic2, + newExternal, + "MyCohort", + project, + cohortPipeline + ); newCohortCmd.Execute(); - ExtractableCohort _extractableCohort2 = new ExtractableCohort(DataExportRepository, newExternal, 2); + var _extractableCohort2 = new ExtractableCohort(DataExportRepository, newExternal, 2); ec.Cohort_ID = _extractableCohort2.ID; ec.SaveToDatabase(); @@ -835,8 +835,8 @@ public void ReExtractToADatabaseWithNewDataAndExtractionIdentifierIsPK() null, db, pipe, null); cmd.Execute(); - var catalogue = CatalogueRepository.GetAllObjects().Where(c => c.Name == "bob").FirstOrDefault(); - var chiColumnInfo = catalogue.CatalogueItems.Where(ci => ci.Name == "chi").First(); + var catalogue = CatalogueRepository.GetAllObjects().FirstOrDefault(static c => c.Name == "bob"); + var chiColumnInfo = catalogue.CatalogueItems.First(static ci => ci.Name == "chi"); var ei = chiColumnInfo.ExtractionInformation; ei.IsPrimaryKey = true; ei.IsExtractionIdentifier = true; @@ -844,11 +844,11 @@ public void ReExtractToADatabaseWithNewDataAndExtractionIdentifierIsPK() var project = new Project(DataExportRepository, "MyProject") { - ProjectNumber = 500 + ProjectNumber = 500, + ExtractionDirectory = Path.GetTempPath() }; - project.ExtractionDirectory = Path.GetTempPath(); project.SaveToDatabase(); - CohortIdentificationConfiguration cic = new CohortIdentificationConfiguration(CatalogueRepository, "Cohort1"); + var cic = new CohortIdentificationConfiguration(CatalogueRepository, "Cohort1"); cic.CreateRootContainerIfNotExists(); var agg1 = new AggregateConfiguration(CatalogueRepository, catalogue, "agg1"); var conf = new AggregateConfiguration(CatalogueRepository, catalogue, "UnitTestShortcutAggregate"); @@ -860,13 +860,13 @@ public void ReExtractToADatabaseWithNewDataAndExtractionIdentifierIsPK() dim.SaveToDatabase(); agg1.SaveToDatabase(); - string CohortDatabaseName = TestDatabaseNames.GetConsistentName("CohortDatabase"); - string cohortTableName = "Cohort"; - string definitionTableName = "CohortDefinition"; - string ExternalCohortTableNameInCatalogue = "CohortTests"; + var CohortDatabaseName = TestDatabaseNames.GetConsistentName("CohortDatabase"); + const string cohortTableName = "Cohort"; + const string definitionTableName = "CohortDefinition"; + var ExternalCohortTableNameInCatalogue = "CohortTests"; const string ReleaseIdentifierFieldName = "ReleaseId"; const string DefinitionTableForeignKeyField = "cohortDefinition_id"; - DiscoveredDatabase _cohortDatabase = DiscoveredServerICanCreateRandomDatabasesAndTablesOn.ExpectDatabase(CohortDatabaseName); + var _cohortDatabase = DiscoveredServerICanCreateRandomDatabasesAndTablesOn.ExpectDatabase(CohortDatabaseName); if (_cohortDatabase.Exists()) DeleteTables(_cohortDatabase); else @@ -920,7 +920,7 @@ public void ReExtractToADatabaseWithNewDataAndExtractionIdentifierIsPK() }; newExternal.SaveToDatabase(); - var cohortPipeline = CatalogueRepository.GetAllObjects().Where(p => p.Name == "CREATE COHORT:By Executing Cohort Identification Configuration").First(); + var cohortPipeline = CatalogueRepository.GetAllObjects().First(static p => p.Name == "CREATE COHORT:By Executing Cohort Identification Configuration"); var newCohortCmd = new ExecuteCommandCreateNewCohortByExecutingACohortIdentificationConfiguration( new ThrowImmediatelyActivator(RepositoryLocator), cic, @@ -928,14 +928,14 @@ public void ReExtractToADatabaseWithNewDataAndExtractionIdentifierIsPK() "MyCohort", project, cohortPipeline - ); + ); newCohortCmd.Execute(); - ExtractableCohort _extractableCohort = new ExtractableCohort(DataExportRepository, newExternal, 1); + var extractableCohort = new ExtractableCohort(DataExportRepository, newExternal, 1); var ec = new ExtractionConfiguration(DataExportRepository, project) { Name = "ext1", - Cohort_ID = _extractableCohort.ID + Cohort_ID = extractableCohort.ID }; ec.AddDatasetToConfiguration(new ExtractableDataSet(DataExportRepository, catalogue)); @@ -951,7 +951,7 @@ public void ReExtractToADatabaseWithNewDataAndExtractionIdentifierIsPK() var argumentTblNamePattern = destinationArguments.Single(a => a.Name == "TableNamingPattern"); var reExtract = destinationArguments.Single(a => a.Name == "AppendDataIfTableExists"); Assert.That(argumentServer.Name, Is.EqualTo("TargetDatabaseServer")); - ExternalDatabaseServer _extractionServer = new ExternalDatabaseServer(CatalogueRepository, "myserver", null) + var _extractionServer = new ExternalDatabaseServer(CatalogueRepository, "myserver", null) { Server = DiscoveredServerICanCreateRandomDatabasesAndTablesOn.Name, Username = DiscoveredServerICanCreateRandomDatabasesAndTablesOn.ExplicitUsernameIfAny, @@ -1014,17 +1014,17 @@ public void ReExtractToADatabaseWithNewDataAndExtractionIdentifierIsPK() //add new entry here var tbl = db.DiscoverTables(false).First(); tbl.Insert(new Dictionary - { - { "chi","1111111111"}, - {"notes","T"}, - {"dtCreated", new DateTime(2001, 1, 2) }, - {"century",19}, - {"surname","1234"}, - {"forename","yes"}, - {"sex","M"}, - }); + { + { "chi","1111111111"}, + {"notes","T"}, + {"dtCreated", new DateTime(2001, 1, 2) }, + {"century",19}, + {"surname","1234"}, + {"forename","yes"}, + {"sex","M"}, + }); - CohortIdentificationConfiguration cic2 = new CohortIdentificationConfiguration(CatalogueRepository, "Cohort1"); + var cic2 = new CohortIdentificationConfiguration(CatalogueRepository, "Cohort1"); cic2.CreateRootContainerIfNotExists(); var agg12 = new AggregateConfiguration(CatalogueRepository, catalogue, "agg1"); _ = new AggregateConfiguration(CatalogueRepository, catalogue, "UnitTestShortcutAggregate"); @@ -1037,7 +1037,7 @@ public void ReExtractToADatabaseWithNewDataAndExtractionIdentifierIsPK() agg12.SaveToDatabase(); newCohortCmd.Execute(); - ExtractableCohort _extractableCohort2 = new ExtractableCohort(DataExportRepository, newExternal, 2); + var _extractableCohort2 = new ExtractableCohort(DataExportRepository, newExternal, 2); ec.Cohort_ID = _extractableCohort2.ID; ec.SaveToDatabase(); @@ -1094,8 +1094,8 @@ public void ExtractToDatabaseUseTriggers() null, db, pipe, null); cmd.Execute(); - var catalogue = CatalogueRepository.GetAllObjects().Where(c => c.Name == "bob").FirstOrDefault(); - var chiColumnInfo = catalogue.CatalogueItems.Where(ci => ci.Name == "chi").First(); + var catalogue = CatalogueRepository.GetAllObjects().FirstOrDefault(static c => c.Name == "bob"); + var chiColumnInfo = catalogue.CatalogueItems.First(static ci => ci.Name == "chi"); var ei = chiColumnInfo.ExtractionInformation; ei.IsPrimaryKey = true; ei.IsExtractionIdentifier = true; @@ -1103,11 +1103,11 @@ public void ExtractToDatabaseUseTriggers() var project = new Project(DataExportRepository, "MyProject") { - ProjectNumber = 500 + ProjectNumber = 500, + ExtractionDirectory = Path.GetTempPath() }; - project.ExtractionDirectory = Path.GetTempPath(); project.SaveToDatabase(); - CohortIdentificationConfiguration cic = new CohortIdentificationConfiguration(CatalogueRepository, "Cohort1"); + var cic = new CohortIdentificationConfiguration(CatalogueRepository, "Cohort1"); cic.CreateRootContainerIfNotExists(); var agg1 = new AggregateConfiguration(CatalogueRepository, catalogue, "agg1"); var conf = new AggregateConfiguration(CatalogueRepository, catalogue, "UnitTestShortcutAggregate"); @@ -1119,13 +1119,13 @@ public void ExtractToDatabaseUseTriggers() dim.SaveToDatabase(); agg1.SaveToDatabase(); - string CohortDatabaseName = TestDatabaseNames.GetConsistentName("CohortDatabase"); - string cohortTableName = "Cohort"; - string definitionTableName = "CohortDefinition"; - string ExternalCohortTableNameInCatalogue = "CohortTests"; + var CohortDatabaseName = TestDatabaseNames.GetConsistentName("CohortDatabase"); + var cohortTableName = "Cohort"; + var definitionTableName = "CohortDefinition"; + var ExternalCohortTableNameInCatalogue = "CohortTests"; const string ReleaseIdentifierFieldName = "ReleaseId"; const string DefinitionTableForeignKeyField = "cohortDefinition_id"; - DiscoveredDatabase _cohortDatabase = DiscoveredServerICanCreateRandomDatabasesAndTablesOn.ExpectDatabase(CohortDatabaseName); + var _cohortDatabase = DiscoveredServerICanCreateRandomDatabasesAndTablesOn.ExpectDatabase(CohortDatabaseName); if (_cohortDatabase.Exists()) DeleteTables(_cohortDatabase); else @@ -1179,7 +1179,7 @@ public void ExtractToDatabaseUseTriggers() }; newExternal.SaveToDatabase(); - var cohortPipeline = CatalogueRepository.GetAllObjects().Where(p => p.Name == "CREATE COHORT:By Executing Cohort Identification Configuration").First(); + var cohortPipeline = CatalogueRepository.GetAllObjects().First(static p => p.Name == "CREATE COHORT:By Executing Cohort Identification Configuration"); var newCohortCmd = new ExecuteCommandCreateNewCohortByExecutingACohortIdentificationConfiguration( new ThrowImmediatelyActivator(RepositoryLocator), cic, @@ -1187,14 +1187,14 @@ public void ExtractToDatabaseUseTriggers() "MyCohort", project, cohortPipeline - ); + ); newCohortCmd.Execute(); - ExtractableCohort _extractableCohort = new ExtractableCohort(DataExportRepository, newExternal, 1); + var extractableCohort = new ExtractableCohort(DataExportRepository, newExternal, 1); var ec = new ExtractionConfiguration(DataExportRepository, project) { Name = "ext1", - Cohort_ID = _extractableCohort.ID + Cohort_ID = extractableCohort.ID }; ec.AddDatasetToConfiguration(new ExtractableDataSet(DataExportRepository, catalogue)); @@ -1205,20 +1205,20 @@ public void ExtractToDatabaseUseTriggers() typeof(ExecuteFullExtractionToDatabaseMSSql), 0, "MS SQL Destination"); var destinationArguments = component.CreateArgumentsForClassIfNotExists() .ToList(); - var argumentServer = destinationArguments.Single(a => a.Name == "TargetDatabaseServer"); - var argumentDbNamePattern = destinationArguments.Single(a => a.Name == "DatabaseNamingPattern"); - var argumentTblNamePattern = destinationArguments.Single(a => a.Name == "TableNamingPattern"); - var reExtract = destinationArguments.Single(a => a.Name == "AppendDataIfTableExists"); + var argumentServer = destinationArguments.Single(static a => a.Name == "TargetDatabaseServer"); + var argumentDbNamePattern = destinationArguments.Single(static a => a.Name == "DatabaseNamingPattern"); + var argumentTblNamePattern = destinationArguments.Single(static a => a.Name == "TableNamingPattern"); + var reExtract = destinationArguments.Single(static a => a.Name == "AppendDataIfTableExists"); Assert.That(argumentServer.Name, Is.EqualTo("TargetDatabaseServer")); - ExternalDatabaseServer _extractionServer = new ExternalDatabaseServer(CatalogueRepository, "myserver", null) + var extractionServer = new ExternalDatabaseServer(CatalogueRepository, "myserver", null) { Server = DiscoveredServerICanCreateRandomDatabasesAndTablesOn.Name, Username = DiscoveredServerICanCreateRandomDatabasesAndTablesOn.ExplicitUsernameIfAny, Password = DiscoveredServerICanCreateRandomDatabasesAndTablesOn.ExplicitPasswordIfAny }; - _extractionServer.SaveToDatabase(); + extractionServer.SaveToDatabase(); - argumentServer.SetValue(_extractionServer); + argumentServer.SetValue(extractionServer); argumentServer.SaveToDatabase(); argumentDbNamePattern.SetValue($"{TestDatabaseNames.Prefix}$p_$n"); argumentDbNamePattern.SaveToDatabase(); @@ -1231,8 +1231,9 @@ public void ExtractToDatabaseUseTriggers() typeof(ExecuteCrossServerDatasetExtractionSource), -1, "Source"); var arguments2 = component2.CreateArgumentsForClassIfNotExists() .ToArray(); - arguments2.Single(a => a.Name.Equals("AllowEmptyExtractions")).SetValue(false); - arguments2.Single(a => a.Name.Equals("AllowEmptyExtractions")).SaveToDatabase(); + var allowEmpty = arguments2.Single(static a => a.Name.Equals("AllowEmptyExtractions")); + allowEmpty.SetValue(false); + allowEmpty.SaveToDatabase(); //configure the component as the destination extractionPipeline.DestinationPipelineComponent_ID = component.ID; @@ -1275,17 +1276,17 @@ public void ExtractToDatabaseUseTriggers() ////add new entry here var tbl = db.DiscoverTables(false).First(); tbl.Insert(new Dictionary - { - { "chi","1111111111"}, - {"notes","T"}, - {"dtCreated", new DateTime(2001, 1, 2) }, - {"century",19}, - {"surname","1234"}, - {"forename","yes"}, - {"sex","M"}, - }); + { + { "chi","1111111111"}, + {"notes","T"}, + {"dtCreated", new DateTime(2001, 1, 2) }, + {"century",19}, + {"surname","1234"}, + {"forename","yes"}, + {"sex","M"}, + }); - CohortIdentificationConfiguration cic2 = new CohortIdentificationConfiguration(CatalogueRepository, "Cohort1"); + var cic2 = new CohortIdentificationConfiguration(CatalogueRepository, "Cohort1"); cic2.CreateRootContainerIfNotExists(); var agg12 = new AggregateConfiguration(CatalogueRepository, catalogue, "agg1"); _ = new AggregateConfiguration(CatalogueRepository, catalogue, "UnitTestShortcutAggregate"); @@ -1298,7 +1299,7 @@ public void ExtractToDatabaseUseTriggers() agg12.SaveToDatabase(); newCohortCmd.Execute(); - ExtractableCohort _extractableCohort2 = new ExtractableCohort(DataExportRepository, newExternal, 2); + var _extractableCohort2 = new ExtractableCohort(DataExportRepository, newExternal, 2); ec.Cohort_ID = _extractableCohort2.ID; ec.SaveToDatabase(); diff --git a/Rdmp.Core.Tests/DataLoad/Engine/Integration/DataTableUploadDestinationTests.cs b/Rdmp.Core.Tests/DataLoad/Engine/Integration/DataTableUploadDestinationTests.cs index dbf274644d..d80a15c3f1 100644 --- a/Rdmp.Core.Tests/DataLoad/Engine/Integration/DataTableUploadDestinationTests.cs +++ b/Rdmp.Core.Tests/DataLoad/Engine/Integration/DataTableUploadDestinationTests.cs @@ -1551,10 +1551,11 @@ public void UseTriggerwithoutPrimaryKey() destination.Dispose(ThrowImmediatelyDataLoadEventListener.Quiet, ex); throw; } - var t = db.DiscoverTables(false).Select(t => t.GetRuntimeName()).ToList(); + + var t = db.DiscoverTables(false).Select(static t => t.GetRuntimeName()).ToList(); Assert.That(t.Contains("DataTableUploadDestinationTests_Archive"), Is.EqualTo(false)); - var destinationTable = db.DiscoverTables(false).Where(t => t.GetRuntimeName() == "DataTableUploadDestinationTests").First(); - var columns = destinationTable.DiscoverColumns().Select(c => c.GetRuntimeName()); + var destinationTable = db.DiscoverTables(false).First(static t => t.GetRuntimeName() == "DataTableUploadDestinationTests"); + var columns = destinationTable.DiscoverColumns().Select(static c => c.GetRuntimeName()); Assert.That(columns.Contains(SpecialFieldNames.DataLoadRunID), Is.EqualTo(false)); } @@ -1586,10 +1587,11 @@ public void UseTriggerwithPrimaryKey() destination.Dispose(ThrowImmediatelyDataLoadEventListener.Quiet, ex); throw; } - var t = db.DiscoverTables(false).Select(t => t.GetRuntimeName()).ToList(); + + var t = db.DiscoverTables(false).Select(static t => t.GetRuntimeName()).ToList(); Assert.That(t.Contains("DataTableUploadDestinationTests_Archive"), Is.EqualTo(true)); - var destinationTable = db.DiscoverTables(false).Where(t => t.GetRuntimeName() == "DataTableUploadDestinationTests").First(); - var columns = destinationTable.DiscoverColumns().Select(c => c.GetRuntimeName()); + var destinationTable = db.DiscoverTables(false).First(static t => t.GetRuntimeName() == "DataTableUploadDestinationTests"); + var columns = destinationTable.DiscoverColumns().Select(static c => c.GetRuntimeName()); Assert.That(columns.Contains(SpecialFieldNames.DataLoadRunID), Is.EqualTo(true)); } @@ -1633,10 +1635,12 @@ public void DataTableUploadClashSameRow() destination.Dispose(ThrowImmediatelyDataLoadEventListener.Quiet, ex); throw; } - var table = db.DiscoverTables(false).Where(t => t.GetRuntimeName() == "DataTableUploadDestinationTests").First(); - var resultDT = table.GetDataTable(); - Assert.That(resultDT.Rows.Count, Is.EqualTo(1)); + + var table = db.DiscoverTables(false).First(static t => t.GetRuntimeName() == "DataTableUploadDestinationTests"); + using var resultDt = table.GetDataTable(); + Assert.That(resultDt.Rows, Has.Count.EqualTo(1)); } + [Test] public void DataTableUploadClashSameRowWithTrigger() { @@ -1678,10 +1682,12 @@ public void DataTableUploadClashSameRowWithTrigger() destination.Dispose(ThrowImmediatelyDataLoadEventListener.Quiet, ex); throw; } - var table = db.DiscoverTables(false).Where(t => t.GetRuntimeName() == "DataTableUploadDestinationTests").First(); - var resultDT = table.GetDataTable(); - Assert.That(resultDT.Rows.Count, Is.EqualTo(1)); + + var table = db.DiscoverTables(false).First(static t => t.GetRuntimeName() == "DataTableUploadDestinationTests"); + using var resultDt = table.GetDataTable(); + Assert.That(resultDt.Rows, Has.Count.EqualTo(1)); } + [Test] public void DataTableUploadClashUpdateNoTrigger() { @@ -1730,12 +1736,13 @@ public void DataTableUploadClashUpdateNoTrigger() destination.PreInitialize(db, toConsole); Assert.Throws(() => destination.ProcessPipelineData(dt1, toConsole, token)); destination.Dispose(ThrowImmediatelyDataLoadEventListener.Quiet, null); - var table = db.DiscoverTables(false).Where(t => t.GetRuntimeName() == "DataTableUploadDestinationTests").First(); - var resultDT = table.GetDataTable(); - Assert.That(resultDT.Rows.Count, Is.EqualTo(1)); - Assert.That(resultDT.Rows[0].ItemArray[0], Is.EqualTo("Fish")); - Assert.That(resultDT.Rows[0].ItemArray[1], Is.EqualTo("Friend")); + var table = db.DiscoverTables(false).First(static t => t.GetRuntimeName() == "DataTableUploadDestinationTests"); + var resultDt = table.GetDataTable(); + Assert.That(resultDt.Rows, Has.Count.EqualTo(1)); + Assert.That(resultDt.Rows[0].ItemArray[0], Is.EqualTo("Fish")); + Assert.That(resultDt.Rows[0].ItemArray[1], Is.EqualTo("Friend")); } + [Test] public void DataTableUploadClashUpdateWithTrigger() { @@ -1777,16 +1784,18 @@ public void DataTableUploadClashUpdateWithTrigger() destination.Dispose(ThrowImmediatelyDataLoadEventListener.Quiet, ex); throw; } - var table = db.DiscoverTables(false).Where(t => t.GetRuntimeName() == "DataTableUploadDestinationTests").First(); - var resultDT = table.GetDataTable(); - Assert.That(resultDT.Rows.Count, Is.EqualTo(1)); - Assert.That(resultDT.Rows[0].ItemArray[0], Is.EqualTo("Fish")); - Assert.That(resultDT.Rows[0].ItemArray[1], Is.EqualTo("Enemy")); - table = db.DiscoverTables(false).Where(t => t.GetRuntimeName() == "DataTableUploadDestinationTests_Archive").First(); - resultDT = table.GetDataTable(); - Assert.That(resultDT.Rows.Count, Is.EqualTo(1)); - Assert.That(resultDT.Rows[0].ItemArray[0], Is.EqualTo("Fish")); + + var table = db.DiscoverTables(false).First(static t => t.GetRuntimeName() == "DataTableUploadDestinationTests"); + using var resultDt = table.GetDataTable(); + Assert.That(resultDt.Rows, Has.Count.EqualTo(1)); + Assert.That(resultDt.Rows[0].ItemArray[0], Is.EqualTo("Fish")); + Assert.That(resultDt.Rows[0].ItemArray[1], Is.EqualTo("Enemy")); + table = db.DiscoverTables(false).First(static t => t.GetRuntimeName() == "DataTableUploadDestinationTests_Archive"); + using var resultDt2 = table.GetDataTable(); + Assert.That(resultDt2.Rows, Has.Count.EqualTo(1)); + Assert.That(resultDt2.Rows[0].ItemArray[0], Is.EqualTo("Fish")); } + //need to test rows to modify ln 354 //test when we drop a column [Test] @@ -1830,15 +1839,16 @@ public void DataTableUploadClashUpdateDropColumnWithTrigger() destination.Dispose(ThrowImmediatelyDataLoadEventListener.Quiet, ex); throw; } - var table = db.DiscoverTables(false).Where(t => t.GetRuntimeName() == "DataTableUploadDestinationTests").First(); - var resultDT = table.GetDataTable(); - Assert.That(resultDT.Rows.Count, Is.EqualTo(1)); - Assert.That(resultDT.Rows[0].ItemArray[0], Is.EqualTo("Fish")); - Assert.That(resultDT.Rows[0].ItemArray[1], Is.EqualTo(string.Empty)); - table = db.DiscoverTables(false).Where(t => t.GetRuntimeName() == "DataTableUploadDestinationTests_Archive").First(); - resultDT = table.GetDataTable(); - Assert.That(resultDT.Rows.Count, Is.EqualTo(1)); - Assert.That(resultDT.Rows[0].ItemArray[0], Is.EqualTo("Fish")); + + var table = db.DiscoverTables(false).First(static t => t.GetRuntimeName() == "DataTableUploadDestinationTests"); + using var resultDt = table.GetDataTable(); + Assert.That(resultDt.Rows, Has.Count.EqualTo(1)); + Assert.That(resultDt.Rows[0].ItemArray[0], Is.EqualTo("Fish")); + Assert.That(resultDt.Rows[0].ItemArray[1], Is.EqualTo(string.Empty)); + table = db.DiscoverTables(false).First(static t => t.GetRuntimeName() == "DataTableUploadDestinationTests_Archive"); + using var resultDt2 = table.GetDataTable(); + Assert.That(resultDt2.Rows, Has.Count.EqualTo(1)); + Assert.That(resultDt2.Rows[0].ItemArray[0], Is.EqualTo("Fish")); } diff --git a/Rdmp.Core.Tests/DataLoad/Engine/Integration/PipelineTests/Sources/DelimitedFileSourceTests_ResolvedAccordingToStrategy.cs b/Rdmp.Core.Tests/DataLoad/Engine/Integration/PipelineTests/Sources/DelimitedFileSourceTests_ResolvedAccordingToStrategy.cs index d4f307b3b4..a0377be2e3 100644 --- a/Rdmp.Core.Tests/DataLoad/Engine/Integration/PipelineTests/Sources/DelimitedFileSourceTests_ResolvedAccordingToStrategy.cs +++ b/Rdmp.Core.Tests/DataLoad/Engine/Integration/PipelineTests/Sources/DelimitedFileSourceTests_ResolvedAccordingToStrategy.cs @@ -189,13 +189,6 @@ public void BadCSV_TooFewCellsInRow(BadDataHandlingStrategy strategy, bool tryTo "Other People To Investigate", "Dennis,Hes ok,35"); - void Adjust(DelimitedFlatFileDataFlowSource a) - { - a.BadDataHandlingStrategy = strategy; - a.AttemptToResolveNewLinesInRecords = tryToResolve; - a.ThrowOnEmptyFiles = true; - } - switch (strategy) { case BadDataHandlingStrategy.ThrowException: @@ -216,6 +209,15 @@ void Adjust(DelimitedFlatFileDataFlowSource a) default: throw new ArgumentOutOfRangeException(nameof(strategy)); } + + return; + + void Adjust(DelimitedFlatFileDataFlowSource a) + { + a.BadDataHandlingStrategy = strategy; + a.AttemptToResolveNewLinesInRecords = tryToResolve; + a.ThrowOnEmptyFiles = true; + } } [TestCase(BadDataHandlingStrategy.DivertRows, true)] @@ -229,13 +231,6 @@ public void BadCSV_TooFewColumnsOnLastLine(BadDataHandlingStrategy strategy, boo "Frank,Is the greatest,100", "Bob"); - void Adjust(DelimitedFlatFileDataFlowSource a) - { - a.BadDataHandlingStrategy = strategy; - a.AttemptToResolveNewLinesInRecords = tryToResolve; - a.ThrowOnEmptyFiles = true; - } - switch (strategy) { case BadDataHandlingStrategy.ThrowException: @@ -256,6 +251,15 @@ void Adjust(DelimitedFlatFileDataFlowSource a) default: throw new ArgumentOutOfRangeException(nameof(strategy)); } + + return; + + void Adjust(DelimitedFlatFileDataFlowSource a) + { + a.BadDataHandlingStrategy = strategy; + a.AttemptToResolveNewLinesInRecords = tryToResolve; + a.ThrowOnEmptyFiles = true; + } } [Test] diff --git a/Rdmp.Core.Tests/DataLoad/Engine/Integration/PipelineTests/Sources/DelimitedFileSourceTests_Unresolveable.cs b/Rdmp.Core.Tests/DataLoad/Engine/Integration/PipelineTests/Sources/DelimitedFileSourceTests_Unresolveable.cs index 84dd2c34bf..645ad405de 100644 --- a/Rdmp.Core.Tests/DataLoad/Engine/Integration/PipelineTests/Sources/DelimitedFileSourceTests_Unresolveable.cs +++ b/Rdmp.Core.Tests/DataLoad/Engine/Integration/PipelineTests/Sources/DelimitedFileSourceTests_Unresolveable.cs @@ -28,13 +28,6 @@ public void BadCSV_UnclosedQuote(BadDataHandlingStrategy strategy) "Frank,Is the greatest,100", "Frank,Is the greatest,100"); - void Adjust(DelimitedFlatFileDataFlowSource a) - { - a.BadDataHandlingStrategy = strategy; - a.ThrowOnEmptyFiles = true; - a.IgnoreQuotes = false; - } - switch (strategy) { case BadDataHandlingStrategy.ThrowException: @@ -57,6 +50,15 @@ void Adjust(DelimitedFlatFileDataFlowSource a) default: throw new ArgumentOutOfRangeException(nameof(strategy)); } + + return; + + void Adjust(DelimitedFlatFileDataFlowSource a) + { + a.BadDataHandlingStrategy = strategy; + a.ThrowOnEmptyFiles = true; + a.IgnoreQuotes = false; + } } [Test] @@ -70,15 +72,16 @@ public void BadCSV_UnclosedQuote_IgnoreQuotes() "Frank,Is the greatest,100", "Frank,Is the greatest,100"); + var dt2 = RunGetChunk(file, Adjust); + Assert.That(dt2.Rows, Has.Count.EqualTo(5)); + Assert.That(dt2.Rows[1]["Description"], Is.EqualTo("\"Is the greatest")); + return; + static void Adjust(DelimitedFlatFileDataFlowSource a) { a.BadDataHandlingStrategy = BadDataHandlingStrategy.ThrowException; a.ThrowOnEmptyFiles = true; a.IgnoreQuotes = true; } - - var dt2 = RunGetChunk(file, Adjust); - Assert.That(dt2.Rows, Has.Count.EqualTo(5)); - Assert.That(dt2.Rows[1]["Description"], Is.EqualTo("\"Is the greatest")); } } \ No newline at end of file diff --git a/Rdmp.Core.Tests/DataLoad/Modules/Attachers/AttacherMEFTest.cs b/Rdmp.Core.Tests/DataLoad/Modules/Attachers/AttacherMEFTest.cs new file mode 100644 index 0000000000..c85967c52c --- /dev/null +++ b/Rdmp.Core.Tests/DataLoad/Modules/Attachers/AttacherMEFTest.cs @@ -0,0 +1,32 @@ +using NPOI.SS.Formula.Functions; +using NUnit.Framework; +using Rdmp.Core.DataLoad.Engine.Attachers; +using Rdmp.Core.DataLoad.Modules.Attachers; +using Rdmp.Core.Repositories; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tests.Common; + +namespace Rdmp.Core.Tests.DataLoad.Modules.Attachers +{ + public class AttacherMEFTest: UnitTests + { + + [Test] + public void AttacherMEFCreationTest() + { + var types = MEF.GetTypes().Where(t => !typeof(RemoteAttacher).IsAssignableTo(t)).ToArray(); + List AttacherPaths = types.Select(t => t.FullName).ToList(); + foreach (var path in AttacherPaths) + { + Assert.DoesNotThrow(() => + { + MEF.CreateA(path); + }); + } + } + } +} diff --git a/Rdmp.Core.Tests/Rdmp.Core.Tests.csproj b/Rdmp.Core.Tests/Rdmp.Core.Tests.csproj index fa6b2ddc9c..cb80e9c6ae 100644 --- a/Rdmp.Core.Tests/Rdmp.Core.Tests.csproj +++ b/Rdmp.Core.Tests/Rdmp.Core.Tests.csproj @@ -5,7 +5,6 @@ Rdmp.Core.Tests Copyright © 2019 false - net8.0 embedded true diff --git a/Rdmp.Core/CommandExecution/AtomicCommands/CohortCreationCommands/ExecuteCommandCreateNewCohortByExecutingACohortIdentificationConfiguration.cs b/Rdmp.Core/CommandExecution/AtomicCommands/CohortCreationCommands/ExecuteCommandCreateNewCohortByExecutingACohortIdentificationConfiguration.cs index 4cb46e7163..7a15a2ab2b 100644 --- a/Rdmp.Core/CommandExecution/AtomicCommands/CohortCreationCommands/ExecuteCommandCreateNewCohortByExecutingACohortIdentificationConfiguration.cs +++ b/Rdmp.Core/CommandExecution/AtomicCommands/CohortCreationCommands/ExecuteCommandCreateNewCohortByExecutingACohortIdentificationConfiguration.cs @@ -70,19 +70,20 @@ public override void Execute() if (cic == null) return; - if (BasicActivator.IsInteractive) { - var PromptForVersionOnCohortCommit = false; - var PromptForVersionOnCohortCommitSetting = BasicActivator.RepositoryLocator.CatalogueRepository.GetAllObjects().Where(s => s.Key == "PromptForVersionOnCohortCommit").FirstOrDefault(); - if (PromptForVersionOnCohortCommitSetting is not null) PromptForVersionOnCohortCommit = Convert.ToBoolean(PromptForVersionOnCohortCommitSetting.Value); - if (PromptForVersionOnCohortCommit && BasicActivator.YesNo("It is recommended to save your cohort as a new version before committing. Would you like to do this?", "Save cohort as new version before committing?")) + if (BasicActivator.IsInteractive) + { + var promptForVersionOnCohortCommit = false; + var promptForVersionOnCohortCommitSetting = BasicActivator.RepositoryLocator.CatalogueRepository.GetAllObjects().FirstOrDefault(static s => s.Key == "PromptForVersionOnCohortCommit"); + if (promptForVersionOnCohortCommitSetting is not null) promptForVersionOnCohortCommit = Convert.ToBoolean(promptForVersionOnCohortCommitSetting.Value); + if (promptForVersionOnCohortCommit && BasicActivator.YesNo("It is recommended to save your cohort as a new version before committing. Would you like to do this?", "Save cohort as new version before committing?")) { var newVersion = new ExecuteCommandCreateVersionOfCohortConfiguration(BasicActivator, cic); newVersion.Execute(); var versions = cic.GetVersions(); cic = versions.Last(); } - } + if (Project == null && BasicActivator.CoreChildProvider is DataExportChildProvider dx) { var projAssociations = dx.AllProjectAssociatedCics diff --git a/Rdmp.Core/CommandExecution/AtomicCommands/ExecuteCommandCloneExtractionConfiguration.cs b/Rdmp.Core/CommandExecution/AtomicCommands/ExecuteCommandCloneExtractionConfiguration.cs index 2fcb3707f1..998843c30e 100644 --- a/Rdmp.Core/CommandExecution/AtomicCommands/ExecuteCommandCloneExtractionConfiguration.cs +++ b/Rdmp.Core/CommandExecution/AtomicCommands/ExecuteCommandCloneExtractionConfiguration.cs @@ -4,7 +4,6 @@ // RDMP is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. // You should have received a copy of the GNU General Public License along with RDMP. If not, see . -using System; using System.Collections.Generic; using System.Linq; using Rdmp.Core.Curation.Data; @@ -16,48 +15,47 @@ namespace Rdmp.Core.CommandExecution.AtomicCommands; -public class ExecuteCommandCloneExtractionConfiguration : BasicCommandExecution, IAtomicCommand +public class ExecuteCommandCloneExtractionConfiguration : BasicCommandExecution { private readonly ExtractionConfiguration _extractionConfiguration; private readonly IBasicActivateItems _activeItems; - private readonly List toRemove = []; - private readonly List toAdd = []; + private readonly List _toRemove = []; + private readonly List _toAdd = []; + private void CheckForDeprecatedCatalogues() { - if (_extractionConfiguration.SelectedDataSets.Any(sd => sd.GetCatalogue().IsDeprecated) && _activeItems.IsInteractive) + if (!_extractionConfiguration.SelectedDataSets.Any(static sd => sd.GetCatalogue().IsDeprecated) || + !_activeItems.IsInteractive) return; + if (!YesNo( + "There are Deprecated catalogues in this Extraction Configuration. Would you like to replace them with their replacement (where available)?", + "Replace Deprecated Catalogues")) return; + + var repo = _activeItems.RepositoryLocator.CatalogueRepository; + var deprecatedDatasets = _extractionConfiguration.SelectedDataSets.Where(static sd => sd.GetCatalogue().IsDeprecated).ToList(); + var replacedBy = repo.GetExtendedProperties(ExtendedProperty.ReplacedBy).ToArray(); + foreach (var ds in deprecatedDatasets) { - if (YesNo("There are Deprecated catalogues in this Extraction Configuration. Would you like to replace them with their replacement (where available)?", "Replace Deprecated Catalogues")) + var replacement = replacedBy.FirstOrDefault(rb => rb.ReferencedObjectID == ds.GetCatalogue().ID); + if (replacement is null) continue; + + var replacementCatalogue = repo.GetObjectByID(int.Parse(replacement.Value)); + while (replacementCatalogue.IsDeprecated) { - var repo = _activeItems.RepositoryLocator.CatalogueRepository; - var DeprecatedDatasets = _extractionConfiguration.SelectedDataSets.Where(sd => sd.GetCatalogue().IsDeprecated).ToList(); - var replacedBy = repo.GetExtendedProperties(ExtendedProperty.ReplacedBy); - foreach (ISelectedDataSets ds in DeprecatedDatasets) + var replacementCatalogueIsReplacedBy = replacedBy.FirstOrDefault(rb => rb.ReferencedObjectID == replacementCatalogue.ID); + if (replacementCatalogueIsReplacedBy is not null) { - var replacement = replacedBy.Where(rb => rb.ReferencedObjectID == ds.GetCatalogue().ID).FirstOrDefault(); - if (replacement is not null) - { - var replacementCatalogue = repo.GetObjectByID(Int32.Parse(replacement.Value)); - while (replacementCatalogue.IsDeprecated) - { - var replacementCatalogueIsReplacedBy = replacedBy.Where(rb => rb.ReferencedObjectID == replacementCatalogue.ID).FirstOrDefault(); - if(replacementCatalogueIsReplacedBy is not null) - { - //have found further down the tree - replacementCatalogue = repo.GetObjectByID(Int32.Parse(replacementCatalogueIsReplacedBy.Value)); - } - else - { - //there is no replacement - break; - } - } - toRemove.Add(ds.ExtractableDataSet); - toAdd.Add(replacementCatalogue); - } + //have found further down the tree + replacementCatalogue = repo.GetObjectByID(int.Parse(replacementCatalogueIsReplacedBy.Value)); + } + else + { + //there is no replacement + break; } - - } + + _toRemove.Add(ds.ExtractableDataSet); + _toAdd.Add(replacementCatalogue); } } @@ -82,11 +80,12 @@ public override void Execute() CheckForDeprecatedCatalogues(); var clone = _extractionConfiguration.DeepCloneWithNewIDs(); - foreach (ExtractableDataSet ds in toRemove) + foreach (var ds in _toRemove.Cast()) { clone.RemoveDatasetFromConfiguration(ds); } - foreach (Catalogue c in toAdd) + + foreach (var c in _toAdd) { //check if the eds already exis var eds = _activeItems.RepositoryLocator.DataExportRepository.GetAllObjectsWhere("Catalogue_ID", c.ID).FirstOrDefault(); @@ -95,8 +94,10 @@ public override void Execute() eds = new ExtractableDataSet(_activeItems.RepositoryLocator.DataExportRepository, c); eds.SaveToDatabase(); } + clone.AddDatasetToConfiguration(eds); } + Publish((DatabaseEntity)clone.Project); Emphasise(clone); } diff --git a/Rdmp.Core/CommandExecution/AtomicCommands/ExecuteCommandDeprecate.cs b/Rdmp.Core/CommandExecution/AtomicCommands/ExecuteCommandDeprecate.cs index 4ef4e502d3..b69f72f548 100644 --- a/Rdmp.Core/CommandExecution/AtomicCommands/ExecuteCommandDeprecate.cs +++ b/Rdmp.Core/CommandExecution/AtomicCommands/ExecuteCommandDeprecate.cs @@ -49,20 +49,18 @@ private void ExecuteImpl() { o.IsDeprecated = _desiredState; o.SaveToDatabase(); - if (!_desiredState && o.GetType() == typeof(Catalogue))//false is not-depricated + if (!_desiredState && o is Catalogue catalogue) //false is not-deprecated { - var c = (Catalogue) o; var replacedBy = _activeItems.RepositoryLocator.CatalogueRepository.GetExtendedProperties(ExtendedProperty.ReplacedBy); - var replacement = replacedBy.Where(rb => rb.ReferencedObjectID == c.ID).FirstOrDefault(); - if(replacedBy != null) - replacement.DeleteInDatabase(); + var replacement = replacedBy.FirstOrDefault(rb => rb.ReferencedObjectID == catalogue.ID); + replacement?.DeleteInDatabase(); } } - if (!BasicActivator.IsInteractive || _o.Length != 1 || _o[0] is not Catalogue || !_desiredState || !BasicActivator.YesNo("Do you have a replacement Catalogue you want to link?", "Replacement")) return; + var cmd = new ExecuteCommandReplacedBy(BasicActivator, _o[0], null) { PromptToPickReplacement = true diff --git a/Rdmp.Core/CommandExecution/AtomicCommands/ExecuteCommandRevertToHistoricalCohortVersion.cs b/Rdmp.Core/CommandExecution/AtomicCommands/ExecuteCommandRevertToHistoricalCohortVersion.cs index 3a271eb87a..7457d533a9 100644 --- a/Rdmp.Core/CommandExecution/AtomicCommands/ExecuteCommandRevertToHistoricalCohortVersion.cs +++ b/Rdmp.Core/CommandExecution/AtomicCommands/ExecuteCommandRevertToHistoricalCohortVersion.cs @@ -35,10 +35,11 @@ public ExecuteCommandRevertToHistoricalCohortVersion(IBasicActivateItems activat public override void Execute() { - if (!_activator.RepositoryLocator.CatalogueRepository.GetAllObjectsWhere("ClonedFrom_ID", _configuration.ID).Where(cic => cic.Version != null && cic.ID == _historicalConfiguration.ID).Any()) + if (!_activator.RepositoryLocator.CatalogueRepository.GetAllObjectsWhere("ClonedFrom_ID", _configuration.ID).Any(cic => cic.Version != null && cic.ID == _historicalConfiguration.ID)) { throw new System.Exception("Historical configuration is not derived from this cohort configuration"); } + base.Execute(); var clone = _historicalConfiguration.CloneIntoExistingConfiguration(ThrowImmediatelyCheckNotifier.Quiet, _configuration,false); Publish(clone); diff --git a/Rdmp.Core/CommandExecution/AtomicCommands/ExecuteCommandUpdateCatalogueDataLocation.cs b/Rdmp.Core/CommandExecution/AtomicCommands/ExecuteCommandUpdateCatalogueDataLocation.cs index 63e5eed8c4..b4cc3c7b1b 100644 --- a/Rdmp.Core/CommandExecution/AtomicCommands/ExecuteCommandUpdateCatalogueDataLocation.cs +++ b/Rdmp.Core/CommandExecution/AtomicCommands/ExecuteCommandUpdateCatalogueDataLocation.cs @@ -56,10 +56,10 @@ public string Check() var discoveredColumns = _table.DiscoverColumns(); - var foundColumn = discoveredColumns.AsEnumerable() - .Where(dc => dc.GetFullyQualifiedName().Contains(newColumn)).FirstOrDefault(); + var foundColumn = discoveredColumns + .AsEnumerable().FirstOrDefault(dc => dc.GetFullyQualifiedName().Contains(newColumn)); if (foundColumn is null) return $"Unable to find column '{newColumn}' in selected table"; - if (foundColumn.DataType.ToString() != item.ColumnInfo.Data_type) + if (foundColumn.DataType?.ToString() != item.ColumnInfo.Data_type) return $"The data type of column '{newColumn}' is of type '{foundColumn.DataType}'. This does not match the current type of '{item.ColumnInfo.Data_type}'"; } diff --git a/Rdmp.Core/Curation/Data/Catalogue.cs b/Rdmp.Core/Curation/Data/Catalogue.cs index 48b71b8293..38031316aa 100644 --- a/Rdmp.Core/Curation/Data/Catalogue.cs +++ b/Rdmp.Core/Curation/Data/Catalogue.cs @@ -35,8 +35,8 @@ namespace Rdmp.Core.Curation.Data; /// -public class Catalogue : DatabaseEntity, IComparable, ICatalogue, IInjectKnown, - IInjectKnown +public sealed class Catalogue : DatabaseEntity, IComparable, ICatalogue, IInjectKnown, + IInjectKnown, IEquatable { #region Database Properties @@ -844,9 +844,19 @@ public int CompareTo(object obj) return -string.Compare(obj.ToString(), ToString(), StringComparison.CurrentCulture); //sort alphabetically (reverse) - throw new Exception($"Cannot compare {GetType().Name} to {obj.GetType().Name}"); + throw new Exception($"Cannot compare {GetType().Name} to {obj?.GetType().Name}"); } + public override bool Equals(object obj) => obj is Catalogue c && (ReferenceEquals(this, c) || Equals(c)); + + public bool Equals(Catalogue other) => base.Equals(other); + + public override int GetHashCode() => base.GetHashCode(); + + public static bool operator ==(Catalogue left, Catalogue right) => Equals(left, right); + + public static bool operator !=(Catalogue left, Catalogue right) => !Equals(left, right); + /// /// Checks that the Catalogue has a sensible Name (See ). Then checks that there are no missing ColumnInfos /// diff --git a/Rdmp.Core/Curation/Data/Overview/OverviewModel.cs b/Rdmp.Core/Curation/Data/Overview/OverviewModel.cs index 5f615f4c69..05a8ddeb61 100644 --- a/Rdmp.Core/Curation/Data/Overview/OverviewModel.cs +++ b/Rdmp.Core/Curation/Data/Overview/OverviewModel.cs @@ -21,7 +21,6 @@ namespace Rdmp.Core.Curation.Data.Overview; /// public class OverviewModel { - private readonly ICatalogue _catalogue; private readonly IBasicActivateItems _activator; private Evaluation _evaluation; @@ -98,6 +97,7 @@ public int GetNumberOfRecords() return _dqeTable.AsEnumerable() .Sum(x => int.Parse(x["# Records"].ToString())); } + } public string GetLatestExtraction() { @@ -130,9 +130,19 @@ private DataTable GetCountsByDatePeriod() } if (_evaluation != null) { - dt = PeriodicityState.GetPeriodicityForDataTableForEvaluation(_evaluation, "ALL", true); - dt.Columns.Add("# Records"); - foreach (DataRow row in dt.Rows) + var logCollection = new ViewLogsCollection(loggingServer, new LogViewerFilter(LoggingTables.DataLoadRun)); + var dataLoadRunSql = $"{logCollection.GetSql()} WHERE ID={maxDataLoadId}"; + var logServer = loggingServer.Discover(DataAccessContext.InternalDataProcessing).Server; + using var loggingCon = logServer.GetConnection(); + loggingCon.Open(); + using var loggingCmd = logServer.GetCommand(dataLoadRunSql, loggingCon); + loggingCmd.CommandTimeout = 30000; + using var loggingDa = server.GetDataAdapter(loggingCmd); + dt.BeginLoadData(); + loggingDa.Fill(dt); + dt.EndLoadData(); + loggingCon.Dispose(); + if (dt.Rows.Count > 0) { row["# Records"] = int.Parse(row["Correct"].ToString()) + int.Parse(row["Wrong"].ToString()) + int.Parse(row["Missing"].ToString()) + int.Parse(row["InvalidatesRow"].ToString()); } @@ -143,6 +153,7 @@ private DataTable GetCountsByDatePeriod() dt.Columns.Remove("Missing"); dt.Columns.Remove("InvalidatesRow"); } + return dt; } diff --git a/Rdmp.Core/DataExport/DataExtraction/Pipeline/Sources/ExecuteDatasetExtractionSource.cs b/Rdmp.Core/DataExport/DataExtraction/Pipeline/Sources/ExecuteDatasetExtractionSource.cs index 7c2ffe9057..d6e602bb4b 100644 --- a/Rdmp.Core/DataExport/DataExtraction/Pipeline/Sources/ExecuteDatasetExtractionSource.cs +++ b/Rdmp.Core/DataExport/DataExtraction/Pipeline/Sources/ExecuteDatasetExtractionSource.cs @@ -323,11 +323,12 @@ public virtual DataTable GetChunk(IDataLoadEventListener listener, GracefulCance if (includesReleaseIdentifier) foreach (var idx in _extractionIdentifiersidx.Distinct().ToList()) { - var sub = Request.ReleaseIdentifierSubstitutions.Where(s => s.Alias == chunk.Columns[idx].ColumnName).FirstOrDefault(); - if (sub != null && sub.ColumnInfo.ExtractionInformations.FirstOrDefault() != null && sub.ColumnInfo.ExtractionInformations.FirstOrDefault().IsPrimaryKey) + var sub = Request.ReleaseIdentifierSubstitutions.FirstOrDefault(s => s.Alias == chunk.Columns[idx].ColumnName); + if (sub?.ColumnInfo.ExtractionInformations.FirstOrDefault()?.IsPrimaryKey == true) { pks.Add(chunk.Columns[idx]); } + foreach (DataRow r in chunk.Rows) { if (r[idx] == DBNull.Value) @@ -347,10 +348,7 @@ public virtual DataTable GetChunk(IDataLoadEventListener listener, GracefulCance } _timeSpentCalculatingDISTINCT.Stop(); - foreach (string name in Request.ColumnsToExtract.Where(c => ((ExtractableColumn)(c)).CatalogueExtractionInformation.IsPrimaryKey).Select(column => ((ExtractableColumn)column).CatalogueExtractionInformation.ToString())) - { - pks.Add(chunk.Columns[name]); - } + pks.AddRange(Request.ColumnsToExtract.Where(static c => ((ExtractableColumn)c).CatalogueExtractionInformation.IsPrimaryKey).Select(static column => ((ExtractableColumn)column).CatalogueExtractionInformation.ToString()).Select(name => chunk.Columns[name])); chunk.PrimaryKey = pks.ToArray(); return chunk; diff --git a/Rdmp.Core/DataLoad/Engine/Attachers/Attacher.cs b/Rdmp.Core/DataLoad/Engine/Attachers/Attacher.cs index 1c30e2ea46..60d97abf64 100644 --- a/Rdmp.Core/DataLoad/Engine/Attachers/Attacher.cs +++ b/Rdmp.Core/DataLoad/Engine/Attachers/Attacher.cs @@ -64,6 +64,11 @@ protected Attacher(bool requestsExternalDatabaseCreation) RequestsExternalDatabaseCreation = requestsExternalDatabaseCreation; } + protected Attacher() + { + RequestsExternalDatabaseCreation = true; + } + public abstract void Check(ICheckNotifier notifier); diff --git a/Rdmp.Core/DataLoad/Engine/Job/JobFactory.cs b/Rdmp.Core/DataLoad/Engine/Job/JobFactory.cs index 8cd0cb83be..86d2d8ef84 100644 --- a/Rdmp.Core/DataLoad/Engine/Job/JobFactory.cs +++ b/Rdmp.Core/DataLoad/Engine/Job/JobFactory.cs @@ -31,8 +31,7 @@ public IDataLoadJob Create(IRDMPPlatformRepositoryServiceLocator repositoryLocat HICDatabaseConfiguration configuration) { var description = _loadMetadata.Name; - LoadDirectory loadDirectory; - loadDirectory = new LoadDirectory(_loadMetadata.LocationOfForLoadingDirectory, _loadMetadata.LocationOfForArchivingDirectory, _loadMetadata.LocationOfExecutablesDirectory, _loadMetadata.LocationOfCacheDirectory); + var loadDirectory = new LoadDirectory(_loadMetadata.LocationOfForLoadingDirectory, _loadMetadata.LocationOfForArchivingDirectory, _loadMetadata.LocationOfExecutablesDirectory, _loadMetadata.LocationOfCacheDirectory); return new DataLoadJob(repositoryLocator, description, _logManager, _loadMetadata, loadDirectory, listener, configuration); diff --git a/Rdmp.Core/DataLoad/Engine/Job/Scheduling/SingleScheduledJobFactory.cs b/Rdmp.Core/DataLoad/Engine/Job/Scheduling/SingleScheduledJobFactory.cs index b707d24f4f..e3a21a3939 100644 --- a/Rdmp.Core/DataLoad/Engine/Job/Scheduling/SingleScheduledJobFactory.cs +++ b/Rdmp.Core/DataLoad/Engine/Job/Scheduling/SingleScheduledJobFactory.cs @@ -38,9 +38,7 @@ public override bool HasJobs() => protected override ScheduledDataLoadJob CreateImpl(IRDMPPlatformRepositoryServiceLocator repositoryLocator, IDataLoadEventListener listener, HICDatabaseConfiguration configuration) { - LoadDirectory loadDirectory; - - loadDirectory = new LoadDirectory(LoadMetadata.LocationOfForLoadingDirectory, LoadMetadata.LocationOfForArchivingDirectory, LoadMetadata.LocationOfExecutablesDirectory, LoadMetadata.LocationOfCacheDirectory); + var loadDirectory = new LoadDirectory(LoadMetadata.LocationOfForLoadingDirectory, LoadMetadata.LocationOfForArchivingDirectory, LoadMetadata.LocationOfExecutablesDirectory, LoadMetadata.LocationOfCacheDirectory); return new ScheduledDataLoadJob(repositoryLocator, JobDescription, LogManager, LoadMetadata, loadDirectory, listener, configuration) diff --git a/Rdmp.Core/DataLoad/Engine/Pipeline/Destinations/DataTableUploadDestination.cs b/Rdmp.Core/DataLoad/Engine/Pipeline/Destinations/DataTableUploadDestination.cs index a286795be7..c6a61249c7 100644 --- a/Rdmp.Core/DataLoad/Engine/Pipeline/Destinations/DataTableUploadDestination.cs +++ b/Rdmp.Core/DataLoad/Engine/Pipeline/Destinations/DataTableUploadDestination.cs @@ -279,10 +279,11 @@ public DataTable ProcessPipelineData(DataTable toProcess, IDataLoadEventListener _firstTime = false; } - if (IncludeTimeStamp && !_discoveredTable.DiscoverColumns().Where(c => c.GetRuntimeName() == _extractionTimeStamp).Any()) + if (IncludeTimeStamp && _discoveredTable.DiscoverColumns().All(c => c.GetRuntimeName() != _extractionTimeStamp)) { _discoveredTable.AddColumn(_extractionTimeStamp, new DatabaseTypeRequest(typeof(DateTime)), true, 30000); } + if (IndexTables) { var indexes = UserDefinedIndexes.Count != 0 ? UserDefinedIndexes : pkColumns.Select(c => c.ColumnName); @@ -353,11 +354,11 @@ public DataTable ProcessPipelineData(DataTable toProcess, IDataLoadEventListener // look up the original value and check we've not already extected the same value under a different release ID var privateIdentifierField = _externalCohortTable.PrivateIdentifierField.Split('.').Last()[1..^1];//remove the "[]" from the identifier field var releaseIdentifierField = _externalCohortTable.ReleaseIdentifierField.Split('.').Last()[1..^1];//remove the "[]" from the identifier field - DiscoveredTable cohortTable = _externalCohortTable.DiscoverCohortTable(); - var lookupDT = cohortTable.GetDataTable(); + var cohortTable = _externalCohortTable.DiscoverCohortTable(); + using var lookupDT = cohortTable.GetDataTable(); var releaseIdIndex = lookupDT.Columns.IndexOf(releaseIdentifierField); var privateIdIndex = lookupDT.Columns.IndexOf(privateIdentifierField); - var foundRow = lookupDT.Rows.Cast().Where(r => r.ItemArray[releaseIdIndex].ToString() == row[pkCol.ColumnName].ToString()).FirstOrDefault(); + var foundRow = lookupDT.Rows.Cast().FirstOrDefault(r => r.ItemArray[releaseIdIndex].ToString() == row[pkCol.ColumnName].ToString()); if (foundRow is not null) { var originalValue = foundRow.ItemArray[privateIdIndex]; @@ -667,16 +668,16 @@ public void Dispose(IDataLoadEventListener listener, Exception pipelineFailureEx _discoveredTable.CreatePrimaryKey(AlterTimeout, pkColumnsToCreate); } } - if (UseTrigger && _discoveredTable.DiscoverColumns().Where(col => col.IsPrimaryKey).Any()) //can't use triggers without a PK - { + if (UseTrigger && _discoveredTable?.DiscoverColumns().Any(static col => col.IsPrimaryKey) == true) //can't use triggers without a PK + { var factory = new TriggerImplementerFactory(_database.Server.DatabaseType); - var _triggerImplementer = factory.Create(_discoveredTable); - var currentStatus = _triggerImplementer.GetTriggerStatus(); + var triggerImplementer = factory.Create(_discoveredTable); + var currentStatus = triggerImplementer.GetTriggerStatus(); if (currentStatus == TriggerStatus.Missing) try { - _triggerImplementer.CreateTrigger(ThrowImmediatelyCheckNotifier.Quiet); + triggerImplementer.CreateTrigger(ThrowImmediatelyCheckNotifier.Quiet); } catch (Exception e) { diff --git a/Rdmp.Core/DataLoad/Modules/Attachers/RemoteAttacher.cs b/Rdmp.Core/DataLoad/Modules/Attachers/RemoteAttacher.cs index 99e5853c54..316479816a 100644 --- a/Rdmp.Core/DataLoad/Modules/Attachers/RemoteAttacher.cs +++ b/Rdmp.Core/DataLoad/Modules/Attachers/RemoteAttacher.cs @@ -24,7 +24,8 @@ namespace Rdmp.Core.DataLoad.Modules.Attachers; public class RemoteAttacher : Attacher, IPluginAttacher { - public RemoteAttacher(bool requestsExternalDatabaseCreation=true) : base(requestsExternalDatabaseCreation) { } + public RemoteAttacher(bool requestsExternalDatabaseCreation = true) : base(requestsExternalDatabaseCreation) { } + public RemoteAttacher() : base(true) { } [DemandsInitialization("How far back to pull data from")] public AttacherHistoricalDurations HistoricalFetchDuration { get; set; } diff --git a/Rdmp.Core/DataLoad/Modules/Attachers/RemoteTableAttacher.cs b/Rdmp.Core/DataLoad/Modules/Attachers/RemoteTableAttacher.cs index fa7ff3cd9c..7d8122586e 100644 --- a/Rdmp.Core/DataLoad/Modules/Attachers/RemoteTableAttacher.cs +++ b/Rdmp.Core/DataLoad/Modules/Attachers/RemoteTableAttacher.cs @@ -40,6 +40,9 @@ public class RemoteTableAttacher : RemoteAttacher public RemoteTableAttacher(bool requestsExternalDatabaseCreation=true) : base(requestsExternalDatabaseCreation) { } + public RemoteTableAttacher() : base(true) + { + } [DemandsInitialization( "The server to connect to (this replaces all other settings e.g. RemoteServer, RemoteDatabaseName etc")] diff --git a/Rdmp.Core/DataLoad/Modules/Mutilators/RegexRedactionMutilator.cs b/Rdmp.Core/DataLoad/Modules/Mutilators/RegexRedactionMutilator.cs index abd4bf7b2a..11a571fc29 100644 --- a/Rdmp.Core/DataLoad/Modules/Mutilators/RegexRedactionMutilator.cs +++ b/Rdmp.Core/DataLoad/Modules/Mutilators/RegexRedactionMutilator.cs @@ -106,14 +106,16 @@ protected override void MutilateTable(IDataLoadJob job, ITableInfo tableInfo, Di using var da = table.Database.Server.GetDataAdapter(cmd); da.Fill(dt); } + dt.EndLoadData(); var redactionUpates = dt.Clone(); - var columnInfo = relatedCatalogues.SelectMany(c => c.CatalogueItems).ToArray().Select(ci => ci.ColumnInfo).Where(ci => ci.GetRuntimeName() == column.GetRuntimeName()).FirstOrDefault(); + var columnInfo = relatedCatalogues.SelectMany(static c => c.CatalogueItems).ToArray().Select(static ci => ci.ColumnInfo).FirstOrDefault(ci => ci.GetRuntimeName() == column.GetRuntimeName()); if (columnInfo is null) { job.OnNotify(this, new NotifyEventArgs(ProgressEventType.Error, "Unable to find the related column info")); return; } + foreach (DataRow row in dt.Rows) { try @@ -123,21 +125,23 @@ protected override void MutilateTable(IDataLoadJob job, ITableInfo tableInfo, Di catch (Exception e) { job.OnNotify(this, new NotifyEventArgs(ProgressEventType.Warning, $"{e.Message}")); - } } + job.OnNotify(this, new NotifyEventArgs(ProgressEventType.Information, $"Regex Redaction mutilator found {dt.Rows.Count} redactions.")); if (redactionsToSaveTable.Rows.Count == 0) return; - for (int i = 0; i < pksToSave.Rows.Count; i++) + + for (var i = 0; i < pksToSave.Rows.Count; i++) { pksToSave.Rows[i]["ID"] = i + 1; } + job.OnNotify(this, new NotifyEventArgs(ProgressEventType.Information, $"Creating Temporary tables")); var t1 = table.Database.CreateTable(nameof(RegexRedactionHelper.Constants.pksToSave_Temp), pksToSave); var t2 = table.Database.CreateTable(nameof(RegexRedactionHelper.Constants.redactionsToSaveTable_Temp), redactionsToSaveTable); job.OnNotify(this, new NotifyEventArgs(ProgressEventType.Information, $"Saving Redactions")); - var _server = relatedCatalogues.First().GetDistinctLiveDatabaseServer(DataAccessContext.InternalDataProcessing, false); - RegexRedactionHelper.SaveRedactions(job.RepositoryLocator.CatalogueRepository, t1, t2, _server, Timeout * 1000); + var server = relatedCatalogues.First().GetDistinctLiveDatabaseServer(DataAccessContext.InternalDataProcessing, false); + RegexRedactionHelper.SaveRedactions(job.RepositoryLocator.CatalogueRepository, t1, t2, server, Timeout * 1000); t1.Drop(); t2.Drop(); job.OnNotify(this, new NotifyEventArgs(ProgressEventType.Information, $"Performing join update")); diff --git a/Rdmp.Core/Rdmp.Core.csproj b/Rdmp.Core/Rdmp.Core.csproj index 44696b6cff..4abe04fb29 100644 --- a/Rdmp.Core/Rdmp.Core.csproj +++ b/Rdmp.Core/Rdmp.Core.csproj @@ -14,7 +14,6 @@ GPL-3.0-or-later Core package for plugin development Copyright 2018-2019 - net8.0 false true true diff --git a/Rdmp.UI.Tests/Rdmp.UI.Tests.csproj b/Rdmp.UI.Tests/Rdmp.UI.Tests.csproj index 760ba5314d..a99c0723dc 100644 --- a/Rdmp.UI.Tests/Rdmp.UI.Tests.csproj +++ b/Rdmp.UI.Tests/Rdmp.UI.Tests.csproj @@ -1,14 +1,13 @@  - net8.0-windows + $(TargetFramework)-windows false true embedded true - NU1701 true true - $(NoWarn);SYSLIB0011 + $(NoWarn);NU1701;SYSLIB0011 false true diff --git a/Rdmp.UI/AggregationUIs/AggregateGraphUI.cs b/Rdmp.UI/AggregationUIs/AggregateGraphUI.cs index e3760d2daf..1245417dd9 100644 --- a/Rdmp.UI/AggregationUIs/AggregateGraphUI.cs +++ b/Rdmp.UI/AggregationUIs/AggregateGraphUI.cs @@ -64,10 +64,13 @@ public partial class AggregateGraphUI : AggregateGraph_Design /// the sensible decision is taken e.g. to not try to render. /// /// + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public bool Silent { get; set; } + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public Scintilla QueryEditor { get; private set; } + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public int Timeout { get => _timeoutControls.Timeout; @@ -166,8 +169,13 @@ public void AbortLoadGraph() llCancel.Visible = false; } + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public Exception Exception { get; private set; } + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public bool Crashed { get; private set; } + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public bool Done { get; private set; } private Task _loadTask; diff --git a/Rdmp.UI/CatalogueSummary/DataQualityReporting/SubComponents/ConsequenceBar.cs b/Rdmp.UI/CatalogueSummary/DataQualityReporting/SubComponents/ConsequenceBar.cs index 14024e008f..1563b9fdc7 100644 --- a/Rdmp.UI/CatalogueSummary/DataQualityReporting/SubComponents/ConsequenceBar.cs +++ b/Rdmp.UI/CatalogueSummary/DataQualityReporting/SubComponents/ConsequenceBar.cs @@ -5,6 +5,7 @@ // You should have received a copy of the GNU General Public License along with RDMP. If not, see . using System; +using System.ComponentModel; using System.Drawing; using System.Windows.Forms; @@ -30,12 +31,22 @@ public ConsequenceBar() public static Color HasValuesColor = Color.Black; public static Color IsNullColor = Color.LightGray; + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public double Correct { get; set; } + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public double Invalid { get; set; } + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public double Missing { get; set; } + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public double Wrong { get; set; } + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public double DBNull { get; set; } + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public string Label { get; set; } protected override void OnPaintBackground(PaintEventArgs e) diff --git a/Rdmp.UI/CatalogueSummary/DataQualityReporting/SubComponents/DQEPivotCategorySelector.cs b/Rdmp.UI/CatalogueSummary/DataQualityReporting/SubComponents/DQEPivotCategorySelector.cs index 9151aa96ef..bb6c250b33 100644 --- a/Rdmp.UI/CatalogueSummary/DataQualityReporting/SubComponents/DQEPivotCategorySelector.cs +++ b/Rdmp.UI/CatalogueSummary/DataQualityReporting/SubComponents/DQEPivotCategorySelector.cs @@ -5,6 +5,7 @@ // You should have received a copy of the GNU General Public License along with RDMP. If not, see . using System; +using System.ComponentModel; using System.Windows.Forms; using Rdmp.Core.DataQualityEngine.Data; @@ -19,6 +20,8 @@ namespace Rdmp.UI.CatalogueSummary.DataQualityReporting.SubComponents; public partial class DQEPivotCategorySelector : UserControl { public event Action PivotCategorySelectionChanged; + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public string SelectedPivotCategory { get; private set; } public DQEPivotCategorySelector() diff --git a/Rdmp.UI/CatalogueSummary/DataQualityReporting/SubComponents/EvaluationTrackBar.cs b/Rdmp.UI/CatalogueSummary/DataQualityReporting/SubComponents/EvaluationTrackBar.cs index 079a6fb1b2..38983f731a 100644 --- a/Rdmp.UI/CatalogueSummary/DataQualityReporting/SubComponents/EvaluationTrackBar.cs +++ b/Rdmp.UI/CatalogueSummary/DataQualityReporting/SubComponents/EvaluationTrackBar.cs @@ -6,6 +6,7 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Drawing; using System.Linq; using System.Windows.Forms; @@ -31,6 +32,7 @@ public EvaluationTrackBar() } + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public Evaluation[] Evaluations { get => _evaluations; diff --git a/Rdmp.UI/CatalogueSummary/LoadEvents/LoadEventsTreeView.cs b/Rdmp.UI/CatalogueSummary/LoadEvents/LoadEventsTreeView.cs index 51cd522b1a..a20dc80d11 100644 --- a/Rdmp.UI/CatalogueSummary/LoadEvents/LoadEventsTreeView.cs +++ b/Rdmp.UI/CatalogueSummary/LoadEvents/LoadEventsTreeView.cs @@ -38,6 +38,7 @@ namespace Rdmp.UI.CatalogueSummary.LoadEvents; /// public partial class LoadEventsTreeView : RDMPUserControl, IObjectCollectionControl { + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public LoadEventsTreeViewObjectCollection Collection { get; set; } private BackgroundWorker _populateLoadHistory = new(); diff --git a/Rdmp.UI/CatalogueSummary/LoadEvents/ResolveFatalErrors.cs b/Rdmp.UI/CatalogueSummary/LoadEvents/ResolveFatalErrors.cs index ef84a0f69f..083ce5a18c 100644 --- a/Rdmp.UI/CatalogueSummary/LoadEvents/ResolveFatalErrors.cs +++ b/Rdmp.UI/CatalogueSummary/LoadEvents/ResolveFatalErrors.cs @@ -5,6 +5,7 @@ // You should have received a copy of the GNU General Public License along with RDMP. If not, see . using System; +using System.ComponentModel; using System.Linq; using Rdmp.Core.Logging; using Rdmp.Core.Logging.PastEvents; @@ -28,6 +29,8 @@ public partial class ResolveFatalErrors : RDMPForm { private readonly LogManager _logManager; private readonly ArchivalFatalError[] _toResolve; + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public Scintilla Explanation { get; set; } public ResolveFatalErrors(IActivateItems activator, LogManager logManager, ArchivalFatalError[] toResolve) : diff --git a/Rdmp.UI/ChecksUI/ChecksUI.cs b/Rdmp.UI/ChecksUI/ChecksUI.cs index 01c9b80148..dd490a933f 100644 --- a/Rdmp.UI/ChecksUI/ChecksUI.cs +++ b/Rdmp.UI/ChecksUI/ChecksUI.cs @@ -6,6 +6,7 @@ using System; using System.Collections.Concurrent; +using System.ComponentModel; using System.Drawing; using System.Threading; using System.Windows.Forms; @@ -123,7 +124,10 @@ private Bitmap ImageGetter(object rowObject) }; } + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public bool CheckingInProgress { get; private set; } + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public bool AllowsYesNoToAll { get; set; } private Timer _timer; diff --git a/Rdmp.UI/ChecksUI/RAGSmiley.cs b/Rdmp.UI/ChecksUI/RAGSmiley.cs index 4cf4744aff..9761fb68a0 100644 --- a/Rdmp.UI/ChecksUI/RAGSmiley.cs +++ b/Rdmp.UI/ChecksUI/RAGSmiley.cs @@ -5,6 +5,7 @@ // You should have received a copy of the GNU General Public License along with RDMP. If not, see . using System; +using System.ComponentModel; using System.Drawing; using System.Linq; using System.Threading.Tasks; @@ -19,6 +20,7 @@ public partial class RAGSmiley : UserControl, IRAGSmiley { private bool _alwaysShowHandCursor; + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public bool AlwaysShowHandCursor { get => _alwaysShowHandCursor; diff --git a/Rdmp.UI/CohortUI/CohortSourceManagement/CreateNewCohortDatabaseWizardUI.cs b/Rdmp.UI/CohortUI/CohortSourceManagement/CreateNewCohortDatabaseWizardUI.cs index 97af70d9b8..07e464e4f8 100644 --- a/Rdmp.UI/CohortUI/CohortSourceManagement/CreateNewCohortDatabaseWizardUI.cs +++ b/Rdmp.UI/CohortUI/CohortSourceManagement/CreateNewCohortDatabaseWizardUI.cs @@ -5,6 +5,7 @@ // You should have received a copy of the GNU General Public License along with RDMP. If not, see . using System; +using System.ComponentModel; using System.Windows.Forms; using Rdmp.Core.CohortCommitting; using Rdmp.Core.DataExport.Data; @@ -53,9 +54,13 @@ protected override void OnLoad(EventArgs e) Activator.RepositoryLocator.DataExportRepository, false); } + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public CreateNewCohortDatabaseWizard Wizard { get; private set; } + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public PrivateIdentifierPrototype PrivateIdentifierPrototype { get; private set; } + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public ExternalCohortTable ExternalCohortTableCreatedIfAny { get; private set; } private void btnDiscoverExtractionIdentifiers_Click(object sender, EventArgs e) diff --git a/Rdmp.UI/CohortUI/CreateHoldoutLookup/CreateHoldoutLookupUI.cs b/Rdmp.UI/CohortUI/CreateHoldoutLookup/CreateHoldoutLookupUI.cs index 238d7a3315..980a391928 100644 --- a/Rdmp.UI/CohortUI/CreateHoldoutLookup/CreateHoldoutLookupUI.cs +++ b/Rdmp.UI/CohortUI/CreateHoldoutLookup/CreateHoldoutLookupUI.cs @@ -6,6 +6,7 @@ using System; +using System.ComponentModel; using System.Windows.Forms; using Rdmp.Core.CohortCommitting.Pipeline; using Rdmp.Core.CommandExecution; @@ -26,6 +27,7 @@ public partial class CreateHoldoutLookupUI : RDMPForm private readonly CohortIdentificationConfiguration _cic; + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public string CohortDescription { get => tbDescription.Text; @@ -53,6 +55,7 @@ public CreateHoldoutLookupUI(IActivateItems activator, IExternalCohortTable targ }); } + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public CohortHoldoutLookupRequest Result { get; set; } private void btnOk_Click(object sender, EventArgs e) diff --git a/Rdmp.UI/CohortUI/ImportCustomData/CohortCreationRequestUI.cs b/Rdmp.UI/CohortUI/ImportCustomData/CohortCreationRequestUI.cs index 58d0a3a5cd..3b1409684a 100644 --- a/Rdmp.UI/CohortUI/ImportCustomData/CohortCreationRequestUI.cs +++ b/Rdmp.UI/CohortUI/ImportCustomData/CohortCreationRequestUI.cs @@ -5,6 +5,7 @@ // You should have received a copy of the GNU General Public License along with RDMP. If not, see . using System; +using System.ComponentModel; using System.Drawing; using System.Linq; using System.Windows.Forms; @@ -36,6 +37,8 @@ public partial class CohortCreationRequestUI : RDMPForm private readonly IExternalCohortTable _target; private IDataExportRepository _repository; + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public string CohortDescription { get => tbDescription.Text; @@ -68,7 +71,10 @@ public CohortCreationRequestUI(IActivateItems activator, IExternalCohortTable ta } + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public CohortCreationRequest Result { get; set; } + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public IProject Project { get; set; } private void btnOk_Click(object sender, EventArgs e) diff --git a/Rdmp.UI/Collections/RDMPCollectionUI.cs b/Rdmp.UI/Collections/RDMPCollectionUI.cs index 86db9042e0..0afcde5309 100644 --- a/Rdmp.UI/Collections/RDMPCollectionUI.cs +++ b/Rdmp.UI/Collections/RDMPCollectionUI.cs @@ -19,6 +19,7 @@ namespace Rdmp.UI.Collections; [TypeDescriptionProvider(typeof(AbstractControlDescriptionProvider))] public abstract class RDMPCollectionUI : RDMPCollectionUI_Design, IConsultableBeforeClosing { + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public RDMPCollectionCommonFunctionality CommonTreeFunctionality { get; private set; } protected RDMPCollectionUI() diff --git a/Rdmp.UI/Collections/SessionCollectionUI.cs b/Rdmp.UI/Collections/SessionCollectionUI.cs index a2bbda6371..797f31df20 100644 --- a/Rdmp.UI/Collections/SessionCollectionUI.cs +++ b/Rdmp.UI/Collections/SessionCollectionUI.cs @@ -5,6 +5,7 @@ // You should have received a copy of the GNU General Public License along with RDMP. If not, see . using System; +using System.ComponentModel; using System.Linq; using System.Windows.Forms; using Rdmp.Core; @@ -31,7 +32,9 @@ public class SessionCollectionUI : RDMPUserControl, IObjectCollectionControl, IC private BrightIdeasSoftware.OLVColumn olvName; private bool _firstTime = true; + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public SessionCollection Collection { get; private set; } + public RDMPCollectionCommonFunctionality CommonTreeFunctionality { get; } = new(); public SessionCollectionUI() diff --git a/Rdmp.UI/CommandExecution/AtomicCommands/ExecuteCommandReorderFilter.cs b/Rdmp.UI/CommandExecution/AtomicCommands/ExecuteCommandReorderFilter.cs index 9e4fe29088..7db441b3a8 100644 --- a/Rdmp.UI/CommandExecution/AtomicCommands/ExecuteCommandReorderFilter.cs +++ b/Rdmp.UI/CommandExecution/AtomicCommands/ExecuteCommandReorderFilter.cs @@ -37,12 +37,9 @@ public override void Execute() { var order = _target.Order; - var filters = _target.FilterContainer.GetFilters().Where(f => f is ConcreteFilter).Select(f => (ConcreteFilter)f).ToArray(); - Array.Sort( - filters, - delegate (ConcreteFilter a, ConcreteFilter b) { return a.Order.CompareTo(b.Order); } - ); - if (!filters.All(c => c.Order != order)) + var filters = _target.FilterContainer.GetFilters().OfType().OrderBy(static f => f.Order).ToArray(); + // Conflict? Create a space by moving earlier filters down one, later filters up one + if (filters.Any(c => c.Order == order)) { foreach (var orderable in filters) { @@ -55,6 +52,7 @@ public override void Execute() ((ISaveable)orderable).SaveToDatabase(); } } + _source.Order = order; _source.SaveToDatabase(); Publish(_target.FilterContainer); diff --git a/Rdmp.UI/DashboardTabs/DashboardableControlHostPanel.cs b/Rdmp.UI/DashboardTabs/DashboardableControlHostPanel.cs index 50ba991d78..e7e50da99b 100644 --- a/Rdmp.UI/DashboardTabs/DashboardableControlHostPanel.cs +++ b/Rdmp.UI/DashboardTabs/DashboardableControlHostPanel.cs @@ -5,6 +5,7 @@ // You should have received a copy of the GNU General Public License along with RDMP. If not, see . using System; +using System.ComponentModel; using System.Drawing; using System.Windows.Forms; using Rdmp.Core.Curation.Data.Dashboarding; @@ -25,6 +26,8 @@ public partial class DashboardableControlHostPanel : RDMPUserControl { private readonly DashboardControl _databaseRecord; private bool _editMode; + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public IDashboardableControl HostedControl { get; private set; } private const float BorderWidth = 5; diff --git a/Rdmp.UI/DataLoadUIs/ANOUIs/ANOTableManagement/ColumnInfoToANOTableConverterUI.cs b/Rdmp.UI/DataLoadUIs/ANOUIs/ANOTableManagement/ColumnInfoToANOTableConverterUI.cs index a17c2f30af..1ae048184f 100644 --- a/Rdmp.UI/DataLoadUIs/ANOUIs/ANOTableManagement/ColumnInfoToANOTableConverterUI.cs +++ b/Rdmp.UI/DataLoadUIs/ANOUIs/ANOTableManagement/ColumnInfoToANOTableConverterUI.cs @@ -63,6 +63,7 @@ public partial class ColumnInfoToANOTableConverterUI : ColumnInfoToANOTableConve private ColumnInfo _columnInfo; private bool _yesToAll; + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public ColumnInfo ColumnInfo { get => _columnInfo; diff --git a/Rdmp.UI/DataLoadUIs/CreateNewLoadMetadataUI.cs b/Rdmp.UI/DataLoadUIs/CreateNewLoadMetadataUI.cs index d71fc73985..73d732c8b3 100644 --- a/Rdmp.UI/DataLoadUIs/CreateNewLoadMetadataUI.cs +++ b/Rdmp.UI/DataLoadUIs/CreateNewLoadMetadataUI.cs @@ -5,6 +5,7 @@ // You should have received a copy of the GNU General Public License along with RDMP. If not, see . using System; +using System.ComponentModel; using System.Windows.Forms; using Rdmp.Core.Curation.Data; using Rdmp.Core.Curation.Data.DataLoad; @@ -24,6 +25,8 @@ namespace Rdmp.UI.DataLoadUIs; public partial class CreateNewLoadMetadataUI : RDMPForm { private readonly Catalogue _catalogue; + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public LoadMetadata LoadMetadataCreatedIfAny { get; set; } public CreateNewLoadMetadataUI(Catalogue catalogue, IActivateItems activator) : base(activator) diff --git a/Rdmp.UI/DataLoadUIs/LoadMetadataUIs/ChooseLoadFolderUI.cs b/Rdmp.UI/DataLoadUIs/LoadMetadataUIs/ChooseLoadFolderUI.cs index 03f21011fa..115c98eee4 100644 --- a/Rdmp.UI/DataLoadUIs/LoadMetadataUIs/ChooseLoadFolderUI.cs +++ b/Rdmp.UI/DataLoadUIs/LoadMetadataUIs/ChooseLoadFolderUI.cs @@ -13,6 +13,7 @@ using Rdmp.UI.ItemActivation; using Rdmp.UI.SimpleDialogs; using Rdmp.UI.TestsAndSetup.ServicePropogation; +using System.ComponentModel; namespace Rdmp.UI.DataLoadUIs.LoadMetadataUIs; @@ -34,6 +35,8 @@ public partial class ChooseLoadDirectoryUI : RDMPForm /// The users final choice of project directory, also check DialogResult for Ok / Cancel /// //public string Result { get; private set; } + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public LoadDirectory ResultDirectory { get; private set; } private Regex _endsWithDataFolder = new(@"[/\\]Data[/\\ ]*$", RegexOptions.IgnoreCase); diff --git a/Rdmp.UI/DataLoadUIs/LoadMetadataUIs/LoadDiagram/StateDiscovery/LoadStateUI.cs b/Rdmp.UI/DataLoadUIs/LoadMetadataUIs/LoadDiagram/StateDiscovery/LoadStateUI.cs index 75b6388766..37221d5156 100644 --- a/Rdmp.UI/DataLoadUIs/LoadMetadataUIs/LoadDiagram/StateDiscovery/LoadStateUI.cs +++ b/Rdmp.UI/DataLoadUIs/LoadMetadataUIs/LoadDiagram/StateDiscovery/LoadStateUI.cs @@ -5,6 +5,7 @@ // You should have received a copy of the GNU General Public License along with RDMP. If not, see . using System; +using System.ComponentModel; using System.Drawing; using System.Windows.Forms; using Rdmp.Core.Icons.IconProvision; @@ -22,6 +23,8 @@ public partial class LoadStateUI : UserControl private Bitmap _unknown; private Bitmap _noLoadUnderway; private Bitmap _executingOrCrashed; + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public LoadState State { get; private set; } public LoadStateUI() diff --git a/Rdmp.UI/DataLoadUIs/ModuleUIs/DataFlowSources/ExplicitTypingCollectionUI.cs b/Rdmp.UI/DataLoadUIs/ModuleUIs/DataFlowSources/ExplicitTypingCollectionUI.cs index db4f786aa8..97d2079195 100644 --- a/Rdmp.UI/DataLoadUIs/ModuleUIs/DataFlowSources/ExplicitTypingCollectionUI.cs +++ b/Rdmp.UI/DataLoadUIs/ModuleUIs/DataFlowSources/ExplicitTypingCollectionUI.cs @@ -6,6 +6,7 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Windows.Forms; using Rdmp.Core.Curation.Data.DataLoad; using Rdmp.Core.DataLoad.Modules.DataFlowSources; @@ -25,6 +26,7 @@ namespace Rdmp.UI.DataLoadUIs.ModuleUIs.DataFlowSources; /// public partial class ExplicitTypingCollectionUI : Form, ICustomUI { + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public ICatalogueRepository CatalogueRepository { get; set; } public ExplicitTypingCollectionUI() diff --git a/Rdmp.UI/DataLoadUIs/ModuleUIs/DataProvider/WebServiceConfigurationUI.cs b/Rdmp.UI/DataLoadUIs/ModuleUIs/DataProvider/WebServiceConfigurationUI.cs index ec825466b1..13d029d7ad 100644 --- a/Rdmp.UI/DataLoadUIs/ModuleUIs/DataProvider/WebServiceConfigurationUI.cs +++ b/Rdmp.UI/DataLoadUIs/ModuleUIs/DataProvider/WebServiceConfigurationUI.cs @@ -5,6 +5,7 @@ // You should have received a copy of the GNU General Public License along with RDMP. If not, see . using System; +using System.ComponentModel; using System.Windows.Forms; using Rdmp.Core.Curation.Data.DataLoad; using Rdmp.Core.DataLoad.Modules.DataProvider; @@ -19,6 +20,7 @@ namespace Rdmp.UI.DataLoadUIs.ModuleUIs.DataProvider; /// public partial class WebServiceConfigurationUI : Form, ICustomUI { + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public ICatalogueRepository CatalogueRepository { get; set; } public WebServiceConfigurationUI() diff --git a/Rdmp.UI/DataLoadUIs/ModuleUIs/LoadProgressUpdating/DataLoadProgressUpdateInfoUI.cs b/Rdmp.UI/DataLoadUIs/ModuleUIs/LoadProgressUpdating/DataLoadProgressUpdateInfoUI.cs index 60b0ae291a..7b4a82ea1d 100644 --- a/Rdmp.UI/DataLoadUIs/ModuleUIs/LoadProgressUpdating/DataLoadProgressUpdateInfoUI.cs +++ b/Rdmp.UI/DataLoadUIs/ModuleUIs/LoadProgressUpdating/DataLoadProgressUpdateInfoUI.cs @@ -5,6 +5,7 @@ // You should have received a copy of the GNU General Public License along with RDMP. If not, see . using System; +using System.ComponentModel; using System.Drawing; using System.Windows.Forms; using Rdmp.Core.Curation.Data.DataLoad; @@ -35,6 +36,7 @@ public partial class DataLoadProgressUpdateInfoUI : Form, ICustomUI(); } + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public ICatalogueRepository CatalogueRepository { get; set; } public void SetGenericUnderlyingObjectTo(ICustomUIDrivenClass value) diff --git a/Rdmp.UI/ExtractionUIs/ExtractionInformationUI.cs b/Rdmp.UI/ExtractionUIs/ExtractionInformationUI.cs index 6c138b64aa..7da337c7eb 100644 --- a/Rdmp.UI/ExtractionUIs/ExtractionInformationUI.cs +++ b/Rdmp.UI/ExtractionUIs/ExtractionInformationUI.cs @@ -53,6 +53,7 @@ namespace Rdmp.UI.ExtractionUIs; /// public partial class ExtractionInformationUI : ExtractionInformationUI_Design, ISaveableUI { + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public ExtractionInformation ExtractionInformation { get; private set; } //Editor that user can type into diff --git a/Rdmp.UI/ExtractionUIs/FilterUIs/ExtractionFilterUI.cs b/Rdmp.UI/ExtractionUIs/FilterUIs/ExtractionFilterUI.cs index 4ef10eb874..a3cb034b24 100644 --- a/Rdmp.UI/ExtractionUIs/FilterUIs/ExtractionFilterUI.cs +++ b/Rdmp.UI/ExtractionUIs/FilterUIs/ExtractionFilterUI.cs @@ -50,6 +50,7 @@ public partial class ExtractionFilterUI : ExtractionFilterUI_Design, ILifetimeSu private AutoCompleteProviderWin _autoCompleteProvider; + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public ISqlParameter[] GlobalFilterParameters { get; private set; } private Scintilla QueryEditor; @@ -212,6 +213,7 @@ protected override void SetBindings(BinderWithErrorProviderFactory rules, Concre /// /// Used for publishing IFilters created here back to the main Catalogue /// + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public Catalogue Catalogue { get; set; } public void RefreshBus_RefreshObject(object sender, RefreshObjectEventArgs e) diff --git a/Rdmp.UI/ExtractionUIs/FilterUIs/ParameterUIs/ExtractionFilterParameterSetUI.cs b/Rdmp.UI/ExtractionUIs/FilterUIs/ParameterUIs/ExtractionFilterParameterSetUI.cs index 0f0dc17a97..ee98f1d455 100644 --- a/Rdmp.UI/ExtractionUIs/FilterUIs/ParameterUIs/ExtractionFilterParameterSetUI.cs +++ b/Rdmp.UI/ExtractionUIs/FilterUIs/ParameterUIs/ExtractionFilterParameterSetUI.cs @@ -27,6 +27,7 @@ public partial class ExtractionFilterParameterSetUI : ExtractionFilterParameterS { private ExtractionFilterParameterSet _extractionFilterParameterSet; + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public ExtractionFilterParameterSet ExtractionFilterParameterSet { get => _extractionFilterParameterSet; diff --git a/Rdmp.UI/ExtractionUIs/FilterUIs/ParameterUIs/ParameterCollectionUI.cs b/Rdmp.UI/ExtractionUIs/FilterUIs/ParameterUIs/ParameterCollectionUI.cs index b6a7cd3c86..de702ad19f 100644 --- a/Rdmp.UI/ExtractionUIs/FilterUIs/ParameterUIs/ParameterCollectionUI.cs +++ b/Rdmp.UI/ExtractionUIs/FilterUIs/ParameterUIs/ParameterCollectionUI.cs @@ -6,6 +6,7 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using System.Windows.Forms; using BrightIdeasSoftware; @@ -46,6 +47,7 @@ namespace Rdmp.UI.ExtractionUIs.FilterUIs.ParameterUIs; /// public partial class ParameterCollectionUI : RDMPUserControl { + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public ParameterCollectionUIOptions Options { get; private set; } private ToolStripMenuItem miAddNewParameter = new("New Parameter..."); diff --git a/Rdmp.UI/ExtractionUIs/FilterUIs/ParameterUIs/ParameterEditorScintillaControlUI.cs b/Rdmp.UI/ExtractionUIs/FilterUIs/ParameterUIs/ParameterEditorScintillaControlUI.cs index 0b8d8ec9b5..794227e3b9 100644 --- a/Rdmp.UI/ExtractionUIs/FilterUIs/ParameterUIs/ParameterEditorScintillaControlUI.cs +++ b/Rdmp.UI/ExtractionUIs/FilterUIs/ParameterUIs/ParameterEditorScintillaControlUI.cs @@ -6,6 +6,7 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; @@ -37,10 +38,13 @@ public partial class ParameterEditorScintillaControlUI : RDMPUserControl public event ParameterEventHandler ParameterChanged = delegate { }; public event Action ProblemObjectsFound = delegate { }; + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public ParameterCollectionUIOptions Options { get; set; } + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public Dictionary ProblemObjects { get; private set; } + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public bool IsBroken { get; private set; } public ParameterEditorScintillaControlUI() diff --git a/Rdmp.UI/ExtractionUIs/JoinsAndLookups/KeyDropLocationUI.cs b/Rdmp.UI/ExtractionUIs/JoinsAndLookups/KeyDropLocationUI.cs index 6004e55efe..216806c57c 100644 --- a/Rdmp.UI/ExtractionUIs/JoinsAndLookups/KeyDropLocationUI.cs +++ b/Rdmp.UI/ExtractionUIs/JoinsAndLookups/KeyDropLocationUI.cs @@ -5,6 +5,7 @@ // You should have received a copy of the GNU General Public License along with RDMP. If not, see . using System; +using System.ComponentModel; using System.Windows.Forms; using BrightIdeasSoftware; using Rdmp.Core.Curation.Data; @@ -19,8 +20,11 @@ namespace Rdmp.UI.ExtractionUIs.JoinsAndLookups; public partial class KeyDropLocationUI : UserControl { private JoinKeyType _keyType; + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public ColumnInfo SelectedColumn { get; private set; } + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public JoinKeyType KeyType { get => _keyType; @@ -39,6 +43,7 @@ public JoinKeyType KeyType /// /// Set this to allow dragging only certain items onto the control. Return true to allow drop and false to prevent it. /// + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public Func IsValidGetter { get; set; } public event Action SelectedColumnChanged; diff --git a/Rdmp.UI/ExtractionUIs/JoinsAndLookups/LookupConfigurationUI.cs b/Rdmp.UI/ExtractionUIs/JoinsAndLookups/LookupConfigurationUI.cs index 0eccd004ea..02ebde98f1 100644 --- a/Rdmp.UI/ExtractionUIs/JoinsAndLookups/LookupConfigurationUI.cs +++ b/Rdmp.UI/ExtractionUIs/JoinsAndLookups/LookupConfigurationUI.cs @@ -259,29 +259,38 @@ private bool ValidateUserInput() HandleError("No Lookup table selected"); return false; } - if (PKRelations.Where(d => d.SelectedItem != null).Count() == 0 || FKRelations.Where(d => d.SelectedItem != null).Count() == 0) + + var pk = PKRelations.Count(static d => d.SelectedItem != null); + var fk = FKRelations.Count(static d => d.SelectedItem != null); + + if (pk == 0 || fk == 0) { HandleError("At least one PK FK mapping must be set"); return false; } - if (PKRelations.Where(d => d.SelectedItem != null).Count() != FKRelations.Where(d => d.SelectedItem != null).Count()) + + if (pk != fk) { HandleError("Must have a 1-to-1 mapping of PK and FK mappings"); return false; } - if (Descriptions.Where(d => d.SelectedItem != null).Count() == 0) + + var descColumnInfos = Descriptions.Where(static d => d.SelectedItem != null).Select(static d => ((ColumnInfo)d.SelectedItem).ID).ToArray(); + if (descColumnInfos.Length == 0) { HandleError("At least one Description column must be set"); return false; } - var descColumnInfos = Descriptions.Where(d => d.SelectedItem != null).Select(d => ((ColumnInfo)d.SelectedItem).ID); - var pkColumnInfos = PKRelations.Where(d => d.SelectedItem != null).Select(d => ((ColumnInfo)d.SelectedItem).ID); - var fkColumnInfos = FKRelations.Where(d => d.SelectedItem != null).Select(d => ((ColumnInfo)d.SelectedItem).ID); + + var pkColumnInfos = PKRelations.Where(static d => d.SelectedItem != null).Select(static d => ((ColumnInfo)d.SelectedItem).ID); + var fkColumnInfos = FKRelations.Where(static d => d.SelectedItem != null).Select(static d => ((ColumnInfo)d.SelectedItem).ID); + if (pkColumnInfos.Intersect(descColumnInfos).Any() || fkColumnInfos.Intersect(descColumnInfos).Any()) { HandleError("A Description Column cannot be used in the PK FK mapping"); return false; } + return true; } diff --git a/Rdmp.UI/LoadExecutionUIs/ExecuteLoadMetadataUI.cs b/Rdmp.UI/LoadExecutionUIs/ExecuteLoadMetadataUI.cs index af64b9cecf..424f03fd44 100644 --- a/Rdmp.UI/LoadExecutionUIs/ExecuteLoadMetadataUI.cs +++ b/Rdmp.UI/LoadExecutionUIs/ExecuteLoadMetadataUI.cs @@ -77,12 +77,12 @@ public override void SetDatabaseObject(IActivateItems activator, LoadMetadata da if (activator.IsInteractive) { - var ShowYestoAllNotoAlldataloadcheck = false; - var ShowYestoAllNotoAlldataloadcheckSetting = activator.RepositoryLocator.CatalogueRepository.GetAllObjects().Where(s => s.Key == "ToggleYestoAllNotoAlldataloadcheck").FirstOrDefault(); - if (ShowYestoAllNotoAlldataloadcheckSetting is not null) ShowYestoAllNotoAlldataloadcheck = Convert.ToBoolean(ShowYestoAllNotoAlldataloadcheckSetting.Value); - checkAndExecuteUI1.AllowsYesNoToAll = ShowYestoAllNotoAlldataloadcheck; - + var showYestoAllNotoAlldataloadcheck = false; + var showYestoAllNotoAlldataloadcheckSetting = activator.RepositoryLocator.CatalogueRepository.GetAllObjects().FirstOrDefault(static s => s.Key == "ToggleYestoAllNotoAlldataloadcheck"); + if (showYestoAllNotoAlldataloadcheckSetting is not null) showYestoAllNotoAlldataloadcheck = Convert.ToBoolean(showYestoAllNotoAlldataloadcheckSetting.Value); + checkAndExecuteUI1.AllowsYesNoToAll = showYestoAllNotoAlldataloadcheck; } + SetButtonStates(null, null); SetLoadProgressGroupBoxState(); diff --git a/Rdmp.UI/LocationsMenu/Ticketing/TicketingControlUI.cs b/Rdmp.UI/LocationsMenu/Ticketing/TicketingControlUI.cs index 22e35854b5..b6c92fdbd1 100644 --- a/Rdmp.UI/LocationsMenu/Ticketing/TicketingControlUI.cs +++ b/Rdmp.UI/LocationsMenu/Ticketing/TicketingControlUI.cs @@ -5,6 +5,7 @@ // You should have received a copy of the GNU General Public License along with RDMP. If not, see . using System; +using System.ComponentModel; using Rdmp.Core.Ticketing; using Rdmp.UI.ItemActivation; using Rdmp.UI.SimpleDialogs; @@ -25,14 +26,18 @@ public partial class TicketingControlUI : RDMPUserControl { private ITicketingSystem _ticketingSystemConfiguration; public event EventHandler TicketTextChanged; + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public bool IsValidTicketName { get; private set; } + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public string TicketText { get => tbTicket.Text; set => tbTicket.Text = value; } + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public string Title { set => gbTicketing.Text = value; diff --git a/Rdmp.UI/MainFormUITabs/ExtractionProgressUI.cs b/Rdmp.UI/MainFormUITabs/ExtractionProgressUI.cs index b779f9e97c..548965b935 100644 --- a/Rdmp.UI/MainFormUITabs/ExtractionProgressUI.cs +++ b/Rdmp.UI/MainFormUITabs/ExtractionProgressUI.cs @@ -24,6 +24,8 @@ namespace Rdmp.UI.MainFormUITabs; public partial class ExtractionProgressUI : ExtractionProgressUI_Design, ISaveableUI { public ExtractionProgress ExtractionProgress => (ExtractionProgress)DatabaseObject; + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public IDetermineDatasetTimespan TimespanCalculator { get; set; } = new DatasetTimespanCalculator(); private Tuple dqeResult; diff --git a/Rdmp.UI/MainFormUITabs/SubComponents/ImportSQLTableUI.cs b/Rdmp.UI/MainFormUITabs/SubComponents/ImportSQLTableUI.cs index 1f13767c28..a55751db82 100644 --- a/Rdmp.UI/MainFormUITabs/SubComponents/ImportSQLTableUI.cs +++ b/Rdmp.UI/MainFormUITabs/SubComponents/ImportSQLTableUI.cs @@ -5,6 +5,7 @@ // You should have received a copy of the GNU General Public License along with RDMP. If not, see . using System; +using System.ComponentModel; using System.Linq; using System.Windows.Forms; using FAnsi.Discovery; @@ -36,8 +37,14 @@ namespace Rdmp.UI.MainFormUITabs.SubComponents; public partial class ImportSQLTableUI : RDMPForm { private readonly bool _allowImportAsCatalogue; + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public ITableInfoImporter Importer { get; private set; } + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public ITableInfo TableInfoCreatedIfAny { get; private set; } + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public string TargetFolder { get; set; } private Project _projectSpecific; diff --git a/Rdmp.UI/Menus/DocumentationNodeMenu.cs b/Rdmp.UI/Menus/DocumentationNodeMenu.cs index 2eaa5dfd03..3bfbd4f798 100644 --- a/Rdmp.UI/Menus/DocumentationNodeMenu.cs +++ b/Rdmp.UI/Menus/DocumentationNodeMenu.cs @@ -6,11 +6,13 @@ using Rdmp.Core.CommandExecution.AtomicCommands; using Rdmp.Core.Providers.Nodes; +using System.ComponentModel; namespace Rdmp.UI.Menus; internal class DocumentationNodeMenu : RDMPContextMenuStrip { + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public DocumentationNode DocumentationNode { get; set; } public DocumentationNodeMenu(RDMPContextMenuStripArgs args, DocumentationNode documentationNode) : base(args, diff --git a/Rdmp.UI/Menus/MenuItems/SaveMenuItem.cs b/Rdmp.UI/Menus/MenuItems/SaveMenuItem.cs index 7f1d6f89f2..9a142d60fd 100644 --- a/Rdmp.UI/Menus/MenuItems/SaveMenuItem.cs +++ b/Rdmp.UI/Menus/MenuItems/SaveMenuItem.cs @@ -5,6 +5,7 @@ // You should have received a copy of the GNU General Public License along with RDMP. If not, see . using System; +using System.ComponentModel; using System.Windows.Forms; using Rdmp.UI.SimpleControls; @@ -19,6 +20,7 @@ public class SaveMenuItem : ToolStripMenuItem { private ISaveableUI _saveable; + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public ISaveableUI Saveable { get => _saveable; diff --git a/Rdmp.UI/Menus/RDMPContextMenuStrip.cs b/Rdmp.UI/Menus/RDMPContextMenuStrip.cs index 428977af85..3fb91d65a1 100644 --- a/Rdmp.UI/Menus/RDMPContextMenuStrip.cs +++ b/Rdmp.UI/Menus/RDMPContextMenuStrip.cs @@ -6,6 +6,7 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Drawing; using System.Linq; using System.Windows.Forms; @@ -35,7 +36,10 @@ namespace Rdmp.UI.Menus; public class RDMPContextMenuStrip : ContextMenuStrip { private readonly object _o; + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public IRDMPPlatformRepositoryServiceLocator RepositoryLocator { get; private set; } + protected IActivateItems _activator; protected readonly AtomicCommandUIFactory AtomicCommandUIFactory; diff --git a/Rdmp.UI/PipelineUIs/DataObjects/DataFlowComponentVisualisation.cs b/Rdmp.UI/PipelineUIs/DataObjects/DataFlowComponentVisualisation.cs index 4930d0d46d..37dc3c72ac 100644 --- a/Rdmp.UI/PipelineUIs/DataObjects/DataFlowComponentVisualisation.cs +++ b/Rdmp.UI/PipelineUIs/DataObjects/DataFlowComponentVisualisation.cs @@ -24,12 +24,15 @@ namespace Rdmp.UI.PipelineUIs.DataObjects; [TechnicalUI] public partial class DataFlowComponentVisualisation : UserControl { + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public object Value { get; set; } + private readonly PipelineComponentRole _role; private ICheckable _checkable; private MandatoryPropertyChecker _mandatoryChecker; + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public bool IsLocked { get => pbPadlock.Visible; diff --git a/Rdmp.UI/PipelineUIs/DataObjects/PipelineComponentVisualisation.cs b/Rdmp.UI/PipelineUIs/DataObjects/PipelineComponentVisualisation.cs index 9d98331c75..bef69e03dd 100644 --- a/Rdmp.UI/PipelineUIs/DataObjects/PipelineComponentVisualisation.cs +++ b/Rdmp.UI/PipelineUIs/DataObjects/PipelineComponentVisualisation.cs @@ -5,6 +5,7 @@ // You should have received a copy of the GNU General Public License along with RDMP. If not, see . using System; +using System.ComponentModel; using System.Drawing; using System.Windows.Forms; using Rdmp.Core.Curation.Data.Pipelines; @@ -30,10 +31,16 @@ internal class PipelineComponentVisualisation : DataFlowComponentVisualisation private Pen _origFullPen; private Exception _exInitialization; + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public bool AllowDrag { get; set; } + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public bool AllowSelection { get; set; } + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public IPipelineComponent PipelineComponent { get; set; } + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public bool IsSelected { get => _isSelected; @@ -45,6 +52,7 @@ public bool IsSelected } } + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public Exception ExInitialization { get => _exInitialization; diff --git a/Rdmp.UI/PipelineUIs/Pipelines/ConfigureAndExecutePipelineUI.cs b/Rdmp.UI/PipelineUIs/Pipelines/ConfigureAndExecutePipelineUI.cs index d06cc7649a..9a4d3c54b5 100644 --- a/Rdmp.UI/PipelineUIs/Pipelines/ConfigureAndExecutePipelineUI.cs +++ b/Rdmp.UI/PipelineUIs/Pipelines/ConfigureAndExecutePipelineUI.cs @@ -6,6 +6,7 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Data; using System.Threading; using System.Threading.Tasks; @@ -103,6 +104,7 @@ public ConfigureAndExecutePipelineUI(DialogArgs args, IPipelineUseCase useCase, private bool _pipelineOptionsSet; + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public DataFlowPipelineEngineFactory PipelineFactory { get; private set; } private void SetPipelineOptions(ICatalogueRepository repository) diff --git a/Rdmp.UI/PipelineUIs/Pipelines/PipelineDiagramUI.cs b/Rdmp.UI/PipelineUIs/Pipelines/PipelineDiagramUI.cs index 6a1efae5c7..760d1d1402 100644 --- a/Rdmp.UI/PipelineUIs/Pipelines/PipelineDiagramUI.cs +++ b/Rdmp.UI/PipelineUIs/Pipelines/PipelineDiagramUI.cs @@ -5,6 +5,7 @@ // You should have received a copy of the GNU General Public License along with RDMP. If not, see . using System; +using System.ComponentModel; using System.Linq; using System.Windows.Forms; using BrightIdeasSoftware; @@ -34,7 +35,10 @@ public partial class PipelineDiagramUI : UserControl { private IPipeline _pipeline; + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public bool AllowSelection { get; set; } + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public bool AllowReOrdering { get; set; } private RAGSmiley pipelineSmiley = new(); diff --git a/Rdmp.UI/PipelineUIs/Pipelines/PipelineSelectionUI.cs b/Rdmp.UI/PipelineUIs/Pipelines/PipelineSelectionUI.cs index a98b0dc91f..215338fbf2 100644 --- a/Rdmp.UI/PipelineUIs/Pipelines/PipelineSelectionUI.cs +++ b/Rdmp.UI/PipelineUIs/Pipelines/PipelineSelectionUI.cs @@ -37,25 +37,26 @@ public partial class PipelineSelectionUI : UserControl, IPipelineSelectionUI private const string ShowAll = "Show All/Incompatible Pipelines"; public bool showAll = false; + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public IPipeline Pipeline { get => _pipeline; set { _pipeline = value; + if (ddPipelines == null) return; - if (ddPipelines != null) + if (_extractionConfiguration is not null && value is not null) { - if (_extractionConfiguration is not null && value is not null) - { - _extractionConfiguration.DefaultPipeline_ID = value.ID; - _extractionConfiguration.SaveToDatabase(); - } - ddPipelines.SelectedItem = value; + _extractionConfiguration.DefaultPipeline_ID = value.ID; + _extractionConfiguration.SaveToDatabase(); } + + ddPipelines.SelectedItem = value; } } + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public override string Text { get => gbPrompt.Text; diff --git a/Rdmp.UI/ProjectUI/Datasets/ConfigureDatasetUI.cs b/Rdmp.UI/ProjectUI/Datasets/ConfigureDatasetUI.cs index 7055027fb2..9f85a723b8 100644 --- a/Rdmp.UI/ProjectUI/Datasets/ConfigureDatasetUI.cs +++ b/Rdmp.UI/ProjectUI/Datasets/ConfigureDatasetUI.cs @@ -46,7 +46,9 @@ namespace Rdmp.UI.ProjectUI.Datasets; /// public partial class ConfigureDatasetUI : ConfigureDatasetUI_Design, ILifetimeSubscriber { + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public SelectedDataSets SelectedDataSet { get; private set; } + private IExtractableDataSet _dataSet; private ExtractionConfiguration _config; diff --git a/Rdmp.UI/ProjectUI/Graphs/ExtractionAggregateGraph.cs b/Rdmp.UI/ProjectUI/Graphs/ExtractionAggregateGraph.cs index fb356db680..32a59ca566 100644 --- a/Rdmp.UI/ProjectUI/Graphs/ExtractionAggregateGraph.cs +++ b/Rdmp.UI/ProjectUI/Graphs/ExtractionAggregateGraph.cs @@ -5,6 +5,7 @@ // You should have received a copy of the GNU General Public License along with RDMP. If not, see . using System; +using System.ComponentModel; using System.Linq; using FAnsi.Discovery.QuerySyntax; using Rdmp.Core.Curation.Data; @@ -35,7 +36,9 @@ namespace Rdmp.UI.ProjectUI.Graphs; /// public sealed class ExtractionAggregateGraphUI : AggregateGraphUI, IObjectCollectionControl { + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public ExtractDatasetCommand Request { get; private set; } + private ExtractionAggregateGraphObjectCollection _collection; protected override AggregateBuilder GetQueryBuilder(AggregateConfiguration aggregateConfiguration) diff --git a/Rdmp.UI/Rdmp.UI.csproj b/Rdmp.UI/Rdmp.UI.csproj index 0df6a98832..42259b7ce8 100644 --- a/Rdmp.UI/Rdmp.UI.csproj +++ b/Rdmp.UI/Rdmp.UI.csproj @@ -14,12 +14,12 @@ UI package for plugin development Copyright 2018-2019 60721bce-e328-45cf-b6d2-b627364fbbfa - net8.0-windows + $(TargetFramework)-windows Copyright © 2019 false true true - 1701;1702;CS1591;NU1701;CA1416 + $(NoWarn) true embedded diff --git a/Rdmp.UI/ScintillaHelper/ScintillaMenu.cs b/Rdmp.UI/ScintillaHelper/ScintillaMenu.cs index 922fbfc4da..db33197c72 100644 --- a/Rdmp.UI/ScintillaHelper/ScintillaMenu.cs +++ b/Rdmp.UI/ScintillaHelper/ScintillaMenu.cs @@ -31,6 +31,7 @@ internal class ScintillaMenu : ContextMenuStrip /// Spell checker for the hosted control. If set then right clicks will spell check the word /// under the caret and show suggestions /// + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public WordList Hunspell { get; set; } public ScintillaMenu(Scintilla scintilla, bool spellCheck) : base() diff --git a/Rdmp.UI/SimpleControls/CheckAndExecuteUI.cs b/Rdmp.UI/SimpleControls/CheckAndExecuteUI.cs index 54299cb7d8..ce989bca8f 100644 --- a/Rdmp.UI/SimpleControls/CheckAndExecuteUI.cs +++ b/Rdmp.UI/SimpleControls/CheckAndExecuteUI.cs @@ -6,6 +6,7 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Threading.Tasks; using System.Windows.Forms; using Rdmp.Core.CommandExecution.AtomicCommands.Automation; @@ -33,7 +34,9 @@ public partial class CheckAndExecuteUI : RDMPUserControl, IConsultableBeforeClos public CommandGetterHandler CommandGetter; + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public bool ChecksPassed { get; private set; } + public bool IsExecuting => _runningTask is { IsCompleted: false }; /// @@ -44,8 +47,10 @@ public partial class CheckAndExecuteUI : RDMPUserControl, IConsultableBeforeClos private RunnerFactory _factory; + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public IRunner CurrentRunner { get; private set; } + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public bool AllowsYesNoToAll { get => checksUI1.AllowsYesNoToAll; @@ -66,6 +71,7 @@ public override void SetItemActivator(IActivateItems activator) private RDMPCommandLineOptions Detatch_CommandGetter() => CommandGetter(CommandLineActivity.run); + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public List HelpStages { get; private set; } //constructor diff --git a/Rdmp.UI/SimpleControls/ConnectionStringTextBox.cs b/Rdmp.UI/SimpleControls/ConnectionStringTextBox.cs index bacaa779ac..be6264ee1f 100644 --- a/Rdmp.UI/SimpleControls/ConnectionStringTextBox.cs +++ b/Rdmp.UI/SimpleControls/ConnectionStringTextBox.cs @@ -6,6 +6,7 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Drawing; using System.Linq; using System.Windows.Forms; @@ -24,6 +25,8 @@ public class ConnectionStringTextBox : TextBox private List supportedKeywords = new(); private bool suppressAutocomplete; + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public DatabaseType DatabaseType { get => _databaseType; diff --git a/Rdmp.UI/SimpleControls/DatabaseTypeUI.cs b/Rdmp.UI/SimpleControls/DatabaseTypeUI.cs index 355b65a903..5bc0eafad3 100644 --- a/Rdmp.UI/SimpleControls/DatabaseTypeUI.cs +++ b/Rdmp.UI/SimpleControls/DatabaseTypeUI.cs @@ -5,6 +5,7 @@ // You should have received a copy of the GNU General Public License along with RDMP. If not, see . using System; +using System.ComponentModel; using System.Windows.Forms; using FAnsi; using Rdmp.Core.ReusableLibraryCode.Icons.IconProvision; @@ -17,6 +18,7 @@ public partial class DatabaseTypeUI : UserControl private DatabaseType _databaseType; public event EventHandler DatabaseTypeChanged; + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public DatabaseType DatabaseType { get => _databaseType; diff --git a/Rdmp.UI/SimpleControls/HelpIcon.cs b/Rdmp.UI/SimpleControls/HelpIcon.cs index cfd2d75070..92436f621a 100644 --- a/Rdmp.UI/SimpleControls/HelpIcon.cs +++ b/Rdmp.UI/SimpleControls/HelpIcon.cs @@ -4,6 +4,7 @@ // RDMP is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. // You should have received a copy of the GNU General Public License along with RDMP. If not, see . +using System.ComponentModel; using System.Windows.Forms; using Rdmp.UI.SimpleDialogs; using Rdmp.UI.TransparentHelpSystem; @@ -20,12 +21,15 @@ public partial class HelpIcon : UserControl /// /// Returns the text that will be displayed when the user hovers over the control (this may be truncated if the text provided to was very long) /// + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public string HoverText { get; private set; } private string _title; private HelpWorkflow _workFlow; private string _originalHoverText; private ToolTip _tt; + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public bool SuppressClick { get; set; } public HelpIcon() diff --git a/Rdmp.UI/SimpleControls/SelectIMapsDirectlyToDatabaseTableComboBox.cs b/Rdmp.UI/SimpleControls/SelectIMapsDirectlyToDatabaseTableComboBox.cs index 83737b7457..82b3fdfe8e 100644 --- a/Rdmp.UI/SimpleControls/SelectIMapsDirectlyToDatabaseTableComboBox.cs +++ b/Rdmp.UI/SimpleControls/SelectIMapsDirectlyToDatabaseTableComboBox.cs @@ -6,6 +6,7 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using System.Windows.Forms; using Rdmp.Core.CommandExecution; @@ -21,6 +22,7 @@ public partial class SelectIMapsDirectlyToDatabaseTableComboBox : UserControl public event EventHandler SelectedItemChanged; private IActivateItems _activator; + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public IMapsDirectlyToDatabaseTable SelectedItem { get => suggestComboBox1.SelectedItem as IMapsDirectlyToDatabaseTable; diff --git a/Rdmp.UI/SimpleControls/ServerDatabaseTableSelector.cs b/Rdmp.UI/SimpleControls/ServerDatabaseTableSelector.cs index 1edc000f97..025ce5e02d 100644 --- a/Rdmp.UI/SimpleControls/ServerDatabaseTableSelector.cs +++ b/Rdmp.UI/SimpleControls/ServerDatabaseTableSelector.cs @@ -31,36 +31,42 @@ public partial class ServerDatabaseTableSelector : UserControl { private bool _allowTableValuedFunctionSelection; + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public string Server { get => cbxServer.Text; set => cbxServer.Text = value; } + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public string Database { get => cbxDatabase.Text; set => cbxDatabase.Text = value; } + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public string Table { private get => cbxTable.Text; set => cbxTable.Text = value; } + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public string Username { get => tbUsername.Text; set => tbUsername.Text = value; } + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public string Password { get => tbPassword.Text; set => tbPassword.Text = value; } + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public string Timeout { get => tbTimeout.Text; @@ -268,6 +274,7 @@ public void SetDefaultServers(string[] defaultServers) cbxServer.Items.AddRange(defaultServers); } + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public bool AllowTableValuedFunctionSelection { get => _allowTableValuedFunctionSelection; @@ -281,6 +288,7 @@ public bool AllowTableValuedFunctionSelection } } + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public DatabaseType DatabaseType { get => databaseTypeUI1.DatabaseType; @@ -289,6 +297,7 @@ public DatabaseType DatabaseType public DiscoveredServer Result => new(GetBuilder()); + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public bool TableShouldBeNovel { set diff --git a/Rdmp.UI/SimpleCounterButton.cs b/Rdmp.UI/SimpleCounterButton.cs index 1849f1f8a3..f3adcb4af1 100644 --- a/Rdmp.UI/SimpleCounterButton.cs +++ b/Rdmp.UI/SimpleCounterButton.cs @@ -4,6 +4,7 @@ // RDMP is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. // You should have received a copy of the GNU General Public License along with RDMP. If not, see . +using System.ComponentModel; using System.Drawing; using System.Drawing.Drawing2D; using System.Windows.Forms; @@ -19,6 +20,7 @@ public class SimpleCounterButton : ToolStripButton { private int? _count; + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public int? Count { get => _count; diff --git a/Rdmp.UI/SimpleDialogs/ChooseLoggingTaskUI.cs b/Rdmp.UI/SimpleDialogs/ChooseLoggingTaskUI.cs index d7e8a89898..8051f3fcdd 100644 --- a/Rdmp.UI/SimpleDialogs/ChooseLoggingTaskUI.cs +++ b/Rdmp.UI/SimpleDialogs/ChooseLoggingTaskUI.cs @@ -5,6 +5,7 @@ // You should have received a copy of the GNU General Public License along with RDMP. If not, see . using System; +using System.ComponentModel; using System.Linq; using System.Windows.Forms; using Rdmp.Core.Curation.Data; @@ -36,6 +37,7 @@ public partial class ChooseLoggingTaskUI : RDMPUserControl, ICheckNotifier private Catalogue _catalogue; private string expectedDatabaseTypeString = "HIC.Logging.Database"; + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public Catalogue Catalogue { get => _catalogue; diff --git a/Rdmp.UI/SimpleDialogs/ForwardEngineering/ConfigureCatalogueExtractabilityUI.cs b/Rdmp.UI/SimpleDialogs/ForwardEngineering/ConfigureCatalogueExtractabilityUI.cs index 2eb50687b4..c10a2c7ce8 100644 --- a/Rdmp.UI/SimpleDialogs/ForwardEngineering/ConfigureCatalogueExtractabilityUI.cs +++ b/Rdmp.UI/SimpleDialogs/ForwardEngineering/ConfigureCatalogueExtractabilityUI.cs @@ -5,6 +5,7 @@ // You should have received a copy of the GNU General Public License along with RDMP. If not, see . using System; +using System.ComponentModel; using System.Diagnostics; using System.Drawing; using System.Linq; @@ -72,7 +73,11 @@ public partial class ConfigureCatalogueExtractabilityUI : RDMPForm, ISaveableUI public ICatalogue CatalogueCreatedIfAny => _catalogue; public ITableInfo TableInfoCreated => _tableInfo; + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public DiscoveredTable TableCreated { get; set; } + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public string TargetFolder { get; set; } private BinderWithErrorProviderFactory _binder; diff --git a/Rdmp.UI/SimpleDialogs/InstanceSettings.cs b/Rdmp.UI/SimpleDialogs/InstanceSettings.cs index cf00011e75..6dfbad2697 100644 --- a/Rdmp.UI/SimpleDialogs/InstanceSettings.cs +++ b/Rdmp.UI/SimpleDialogs/InstanceSettings.cs @@ -58,14 +58,14 @@ private void AddTooltip(Control c, string propertyName) private void RegisterCheckbox(CheckBox cb, string propertyName) { - var prop = _settings.Where(s => s.Key == propertyName).FirstOrDefault(); - var value = false; + var prop = _settings.FirstOrDefault(s => s.Key == propertyName); if (prop is null) { prop = new Setting(_activator.RepositoryLocator.CatalogueRepository, propertyName, Convert.ToString(false)); prop.SaveToDatabase(); } - value = Convert.ToBoolean(prop.Value); + + var value = Convert.ToBoolean(prop.Value); checkboxDictionary.Add(cb, prop); cb.Checked = value; diff --git a/Rdmp.UI/SimpleDialogs/NewfindUI.cs b/Rdmp.UI/SimpleDialogs/NewfindUI.cs index 9d65abf063..a6c9ddac58 100644 --- a/Rdmp.UI/SimpleDialogs/NewfindUI.cs +++ b/Rdmp.UI/SimpleDialogs/NewfindUI.cs @@ -38,12 +38,12 @@ public partial class NewfindUI : Form private readonly bool _showReplaceOptions = false; - private void SimulateClickForAutoFilter() + private void SimulateClickForAutoFilter() { - var item = newFindToolStrip.Items.Find((typeof(T)).Name, false).FirstOrDefault(); - if (item is not null) - item.PerformClick(); + var item = newFindToolStrip.Items.Find(typeof(T2).Name, false).FirstOrDefault(); + item?.PerformClick(); } + private void PresetFiltersBasedOnFocusItem(RDMPUserControl focusItem) { var focusItemType = focusItem.GetType(); diff --git a/Rdmp.UI/SimpleDialogs/Reports/DataGeneratorUI.cs b/Rdmp.UI/SimpleDialogs/Reports/DataGeneratorUI.cs index 55a01375fb..9ab0926b29 100644 --- a/Rdmp.UI/SimpleDialogs/Reports/DataGeneratorUI.cs +++ b/Rdmp.UI/SimpleDialogs/Reports/DataGeneratorUI.cs @@ -5,6 +5,7 @@ // You should have received a copy of the GNU General Public License along with RDMP. If not, see . using System; +using System.ComponentModel; using System.IO; using System.Threading; using System.Windows.Forms; @@ -27,6 +28,7 @@ public DataGeneratorUI() cbGenerate.Checked = true; } + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public IDataGenerator Generator { get => _generator; @@ -82,6 +84,7 @@ private void trackBar1_MouseUp(object sender, MouseEventArgs e) TrackBarMouseUp?.Invoke(); } + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public bool Generate { get => cbGenerate.Checked; diff --git a/Rdmp.UI/SimpleDialogs/Reports/GenerateTestDataUI.cs b/Rdmp.UI/SimpleDialogs/Reports/GenerateTestDataUI.cs index ebd0b00d07..c1b17061c1 100644 --- a/Rdmp.UI/SimpleDialogs/Reports/GenerateTestDataUI.cs +++ b/Rdmp.UI/SimpleDialogs/Reports/GenerateTestDataUI.cs @@ -17,6 +17,7 @@ using Rdmp.UI.TestsAndSetup.ServicePropogation; using Rdmp.UI.TransparentHelpSystem; using Rdmp.UI.Tutorials; +using System.ComponentModel; namespace Rdmp.UI.SimpleDialogs.Reports; @@ -35,7 +36,9 @@ namespace Rdmp.UI.SimpleDialogs.Reports; /// public partial class GenerateTestDataUI : RDMPForm { + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public HelpWorkflow HelpWorkflow { get; private set; } + private int? _seed; public GenerateTestDataUI(IActivateItems activator, ICommandExecution command) : base(activator) diff --git a/Rdmp.UI/SimpleDialogs/SelectDialog.cs b/Rdmp.UI/SimpleDialogs/SelectDialog.cs index f3f0c768ab..5c0402122b 100644 --- a/Rdmp.UI/SimpleDialogs/SelectDialog.cs +++ b/Rdmp.UI/SimpleDialogs/SelectDialog.cs @@ -7,6 +7,7 @@ using System; using System.Collections; using System.Collections.Generic; +using System.ComponentModel; using System.Drawing; using System.Linq; using System.Text.RegularExpressions; @@ -73,11 +74,13 @@ public partial class SelectDialog : Form, IVirtualListDataSource where T : cl /// public T Selected; + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public HashSet MultiSelected { get; private set; } /// /// Hides the Type selection toggle buttons and forces results to only appear matching the given Type /// + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public Type AlwaysFilterOn { get => _alwaysFilterOn; @@ -93,6 +96,7 @@ public Type AlwaysFilterOn } } + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public bool AllowMultiSelect { get => olv.MultiSelect; diff --git a/Rdmp.UI/SimpleDialogs/ServerDatabaseTableSelectorDialog.cs b/Rdmp.UI/SimpleDialogs/ServerDatabaseTableSelectorDialog.cs index 714dc29287..7cf160c5f4 100644 --- a/Rdmp.UI/SimpleDialogs/ServerDatabaseTableSelectorDialog.cs +++ b/Rdmp.UI/SimpleDialogs/ServerDatabaseTableSelectorDialog.cs @@ -5,6 +5,7 @@ // You should have received a copy of the GNU General Public License along with RDMP. If not, see . using System; +using System.ComponentModel; using System.Windows.Forms; using FAnsi; using FAnsi.Discovery; @@ -38,6 +39,7 @@ public ServerDatabaseTableSelectorDialog(string taskDescription, bool includeTab public DiscoveredDatabase SelectedDatabase => serverDatabaseTableSelector1.GetDiscoveredDatabase(); public DiscoveredTable SelectedTable => serverDatabaseTableSelector1.GetDiscoveredTable(); + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public bool AllowTableValuedFunctionSelection { get => serverDatabaseTableSelector1.AllowTableValuedFunctionSelection; diff --git a/Rdmp.UI/SimpleDialogs/SimpleFileImporting/CreateNewCatalogueByImportingFileUI.cs b/Rdmp.UI/SimpleDialogs/SimpleFileImporting/CreateNewCatalogueByImportingFileUI.cs index 86e56bc6d6..a924e63db2 100644 --- a/Rdmp.UI/SimpleDialogs/SimpleFileImporting/CreateNewCatalogueByImportingFileUI.cs +++ b/Rdmp.UI/SimpleDialogs/SimpleFileImporting/CreateNewCatalogueByImportingFileUI.cs @@ -5,6 +5,7 @@ // You should have received a copy of the GNU General Public License along with RDMP. If not, see . using System; +using System.ComponentModel; using System.Data; using System.Drawing; using System.IO; @@ -47,7 +48,10 @@ public partial class CreateNewCatalogueByImportingFileUI : RDMPForm private FileInfo _selectedFile; private DataFlowPipelineContext _context; + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public HelpWorkflow HelpWorkflow { get; set; } + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public string TargetFolder { get; set; } public CreateNewCatalogueByImportingFileUI(IActivateItems activator, diff --git a/Rdmp.UI/SimpleDialogs/SimpleFileImporting/CreateNewCatalogueByImportingFileUI_Advanced.cs b/Rdmp.UI/SimpleDialogs/SimpleFileImporting/CreateNewCatalogueByImportingFileUI_Advanced.cs index cf581b735f..8d5f1fef55 100644 --- a/Rdmp.UI/SimpleDialogs/SimpleFileImporting/CreateNewCatalogueByImportingFileUI_Advanced.cs +++ b/Rdmp.UI/SimpleDialogs/SimpleFileImporting/CreateNewCatalogueByImportingFileUI_Advanced.cs @@ -5,6 +5,7 @@ // You should have received a copy of the GNU General Public License along with RDMP. If not, see . using System; +using System.ComponentModel; using System.IO; using System.Windows.Forms; using FAnsi.Discovery; @@ -41,6 +42,7 @@ public partial class CreateNewCatalogueByImportingFileUI_Advanced : UserControl private FileInfo _file; private Project _projectSpecific; + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public ICatalogue CatalogueCreatedIfAny { get; private set; } public CreateNewCatalogueByImportingFileUI_Advanced(IActivateItems activator, DiscoveredDatabase database, diff --git a/Rdmp.UI/SimpleDialogs/SqlDialogs/SQLPreviewWindow.cs b/Rdmp.UI/SimpleDialogs/SqlDialogs/SQLPreviewWindow.cs index e03d518666..b12f335a70 100644 --- a/Rdmp.UI/SimpleDialogs/SqlDialogs/SQLPreviewWindow.cs +++ b/Rdmp.UI/SimpleDialogs/SqlDialogs/SQLPreviewWindow.cs @@ -38,6 +38,7 @@ public SQLPreviewWindow(string title, string msg, string sql) btnOk.Select(); } + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public bool YesToAll { get; set; } private void btnOk_Click(object sender, EventArgs e) diff --git a/Rdmp.UI/SimpleDialogs/TypeTextOrCancelDialog.cs b/Rdmp.UI/SimpleDialogs/TypeTextOrCancelDialog.cs index 83a0529ce6..a067ef6fdb 100644 --- a/Rdmp.UI/SimpleDialogs/TypeTextOrCancelDialog.cs +++ b/Rdmp.UI/SimpleDialogs/TypeTextOrCancelDialog.cs @@ -5,6 +5,7 @@ // You should have received a copy of the GNU General Public License along with RDMP. If not, see . using System; +using System.ComponentModel; using System.Drawing; using System.Windows.Forms; using FAnsi.Discovery; @@ -29,6 +30,7 @@ public partial class TypeTextOrCancelDialog : Form /// /// True to require that text typed be sane for usage as a column name, table name etc e.g. "bob" but not "bob::bbbbb". /// + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public bool RequireSaneHeaderText { get; set; } //"Column Name","Enter name for column (this should NOT include any qualifiers e.g. database name)", 300); diff --git a/Rdmp.UI/SimpleDialogs/WideMessageBox.cs b/Rdmp.UI/SimpleDialogs/WideMessageBox.cs index 7c1601df18..4e8813f211 100644 --- a/Rdmp.UI/SimpleDialogs/WideMessageBox.cs +++ b/Rdmp.UI/SimpleDialogs/WideMessageBox.cs @@ -6,6 +6,7 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Drawing; using System.Linq; using System.Text; @@ -40,6 +41,7 @@ public partial class WideMessageBox : Form /// /// The currently displayed message /// + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public WideMessageBoxArgs Args { get; set; } private readonly Stack _navigationStack = new(); diff --git a/Rdmp.UI/SuggestComboBox.cs b/Rdmp.UI/SuggestComboBox.cs index f2dd69f17e..787a1c490a 100644 --- a/Rdmp.UI/SuggestComboBox.cs +++ b/Rdmp.UI/SuggestComboBox.cs @@ -30,6 +30,8 @@ public class SuggestComboBox : ComboBox private Expression> _suggestListOrderRule; private Func _suggestListOrderRuleCompiled; + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public int SuggestBoxHeight { get => _suggLb.Height; @@ -43,6 +45,7 @@ public int SuggestBoxHeight /// If the item-type of the ComboBox is not string, /// you can set here which property should be used /// + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public Expression>> PropertySelector { get => _propertySelector; @@ -61,12 +64,14 @@ public Expression>> PropertySelector /// 1st string: list item /// 2nd string: typed text /// + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public Expression> FilterRule { get => _filterRule; set { if (value == null) return; + _filterRule = value; _filterRuleCompiled = item => value.Compile()(item, Text); } @@ -77,12 +82,14 @@ public Expression> FilterRule /// (as Expression here because simple lamda (func) is not serializable) /// default: alphabetic ordering /// + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public Expression> SuggestListOrderRule { get => _suggestListOrderRule; set { if (value == null) return; + _suggestListOrderRule = value; _suggestListOrderRuleCompiled = value.Compile(); } diff --git a/Rdmp.UI/TestsAndSetup/ServicePropogation/RDMPForm.cs b/Rdmp.UI/TestsAndSetup/ServicePropogation/RDMPForm.cs index 1604d20c3a..b876df1b80 100644 --- a/Rdmp.UI/TestsAndSetup/ServicePropogation/RDMPForm.cs +++ b/Rdmp.UI/TestsAndSetup/ServicePropogation/RDMPForm.cs @@ -24,11 +24,15 @@ public class RDMPForm : Form, IRDMPControl /// /// Whether escape keystrokes should trigger form closing (defaults to true). /// + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public bool CloseOnEscape { get; set; } protected readonly bool VisualStudioDesignMode; + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public IActivateItems Activator { get; private set; } + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public RDMPControlCommonFunctionality CommonFunctionality { get; private set; } /// diff --git a/Rdmp.UI/TestsAndSetup/ServicePropogation/RDMPSingleDatabaseObjectControl.cs b/Rdmp.UI/TestsAndSetup/ServicePropogation/RDMPSingleDatabaseObjectControl.cs index fa5536bff8..cc89c58a4a 100644 --- a/Rdmp.UI/TestsAndSetup/ServicePropogation/RDMPSingleDatabaseObjectControl.cs +++ b/Rdmp.UI/TestsAndSetup/ServicePropogation/RDMPSingleDatabaseObjectControl.cs @@ -5,6 +5,7 @@ // You should have received a copy of the GNU General Public License along with RDMP. If not, see . using System; +using System.ComponentModel; using System.Drawing; using System.Linq; using System.Windows.Forms; @@ -43,6 +44,7 @@ public abstract class RDMPSingleDatabaseObjectControl : RDMPUserControl, IRDM /// and create when changes are saved. Using this field requires /// declaring yourself /// + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public bool UseCommitSystem { get; set; } = false; /// @@ -64,12 +66,15 @@ public abstract class RDMPSingleDatabaseObjectControl : RDMPUserControl, IRDM private IActivateItems _activator; + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public DatabaseEntity DatabaseObject { get; private set; } + protected RDMPCollection AssociatedCollection = RDMPCollection.None; /// /// True if the hosted . This property is detected and update during SetDatabaseObject so use it only after this call has been made /// + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public bool ReadOnly { get; set; } protected RDMPSingleDatabaseObjectControl() diff --git a/Rdmp.UI/TestsAndSetup/ServicePropogation/RDMPUserControl.cs b/Rdmp.UI/TestsAndSetup/ServicePropogation/RDMPUserControl.cs index 414572b8fa..8598be8429 100644 --- a/Rdmp.UI/TestsAndSetup/ServicePropogation/RDMPUserControl.cs +++ b/Rdmp.UI/TestsAndSetup/ServicePropogation/RDMPUserControl.cs @@ -22,7 +22,10 @@ namespace Rdmp.UI.TestsAndSetup.ServicePropogation; [TypeDescriptionProvider(typeof(AbstractControlDescriptionProvider))] public abstract class RDMPUserControl : UserControl, IRDMPControl { + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public RDMPControlCommonFunctionality CommonFunctionality { get; private set; } + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public IActivateItems Activator { get; private set; } protected readonly bool VisualStudioDesignMode; diff --git a/Rdmp.UI/TestsAndSetup/StartupUI.cs b/Rdmp.UI/TestsAndSetup/StartupUI.cs index e8e89b4073..a913486201 100644 --- a/Rdmp.UI/TestsAndSetup/StartupUI.cs +++ b/Rdmp.UI/TestsAndSetup/StartupUI.cs @@ -5,6 +5,7 @@ // You should have received a copy of the GNU General Public License along with RDMP. If not, see . using System; +using System.ComponentModel; using System.Linq; using System.Reflection; using System.Text.RegularExpressions; @@ -33,6 +34,7 @@ public partial class StartupUI : Form, ICheckNotifier /// /// True if we failed to reach the catalogue database /// + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public bool CouldNotReachTier1Database { get; private set; } @@ -74,6 +76,7 @@ public static string GetVersion() } + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public bool DoNotContinue { get; set; } private void StartupDatabaseFound(object sender, PlatformDatabaseFoundEventArgs eventArgs) @@ -262,8 +265,8 @@ private void HandleDatabaseFoundOnSimpleUI(PlatformDatabaseFoundEventArgs eventA case RDMPPlatformDatabaseStatus.RequiresPatching: - if (MessageBox.Show($"Patching Required on database of type {eventArgs.Patcher.Name}", "Patch", - MessageBoxButtons.YesNo) == DialogResult.Yes) + if (MessageBox.Show($"Patching Required on database of type {eventArgs.Patcher.Name}", "Patch RDMP", + MessageBoxButtons.OKCancel) == DialogResult.OK) { PatchingUI.ShowIfRequired( eventArgs.Repository.DiscoveredServer.GetCurrentDatabase(), @@ -272,8 +275,8 @@ private void HandleDatabaseFoundOnSimpleUI(PlatformDatabaseFoundEventArgs eventA } else { - MessageBox.Show("Patching was cancelled, application will exit"); - Application.Exit(); + MessageBox.Show("Patching was cancelled. Apply Patch to use the latest version of RDMP. Application will exit."); + Environment.Exit(0); } break; diff --git a/Rdmp.UI/Validation/ResolveMissingTargetPropertiesUI.cs b/Rdmp.UI/Validation/ResolveMissingTargetPropertiesUI.cs index 7a176e4a6f..5dac5da67e 100644 --- a/Rdmp.UI/Validation/ResolveMissingTargetPropertiesUI.cs +++ b/Rdmp.UI/Validation/ResolveMissingTargetPropertiesUI.cs @@ -6,6 +6,7 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Drawing; using System.Linq; using System.Windows.Forms; @@ -38,6 +39,7 @@ public ResolveMissingTargetPropertiesUI(Validator validator, ExtractionInformati lbMissingReferences.Items.AddRange(GetMissingReferences(validator, availableColumns).ToArray()); } + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public Validator AdjustedValidator { get; set; } public static IEnumerable GetUnReferencedColumns(Validator v, IEnumerable columns) diff --git a/Rdmp.UI/Validation/ValidationSetupUI.cs b/Rdmp.UI/Validation/ValidationSetupUI.cs index 5ff3c08faf..7e43c2406c 100644 --- a/Rdmp.UI/Validation/ValidationSetupUI.cs +++ b/Rdmp.UI/Validation/ValidationSetupUI.cs @@ -41,6 +41,7 @@ public partial class ValidationSetupUI : ValidationSetupForm_Design, ISaveableUI { private string _noPrimaryConstraintText = "No Primary Constraint Defined"; + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public Validator Validator { get; private set; } private bool bSuppressChangeEvents; diff --git a/Rdmp.UI/Versioning/CreatePlatformDatabase.cs b/Rdmp.UI/Versioning/CreatePlatformDatabase.cs index 07d110b572..334fecbb2f 100644 --- a/Rdmp.UI/Versioning/CreatePlatformDatabase.cs +++ b/Rdmp.UI/Versioning/CreatePlatformDatabase.cs @@ -5,6 +5,7 @@ // You should have received a copy of the GNU General Public License along with RDMP. If not, see . using System; +using System.ComponentModel; using System.Threading.Tasks; using System.Windows.Forms; using FAnsi; @@ -37,6 +38,8 @@ public partial class CreatePlatformDatabase : Form private IPatcher _patcher; private Task _tCreateDatabase; + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public DiscoveredDatabase DatabaseCreatedIfAny { get; private set; } /// diff --git a/Rdmp.UI/Versioning/PatchingUI.cs b/Rdmp.UI/Versioning/PatchingUI.cs index d168e69380..47e9ba8a4c 100644 --- a/Rdmp.UI/Versioning/PatchingUI.cs +++ b/Rdmp.UI/Versioning/PatchingUI.cs @@ -30,7 +30,6 @@ public partial class PatchingUI : Form private readonly DiscoveredDatabase _database; private readonly ITableRepository _repository; - private bool _yesToAll; private IPatcher _patcher; private PatchingUI(DiscoveredDatabase database, ITableRepository repository, IPatcher patcher) @@ -38,9 +37,8 @@ private PatchingUI(DiscoveredDatabase database, ITableRepository repository, IPa _database = database; _repository = repository; _patcher = patcher; - InitializeComponent(); - + this.btnAttemptPatching.Enabled = false; if (LicenseManager.UsageMode == LicenseUsageMode.Designtime) return; @@ -57,6 +55,8 @@ private PatchingUI(DiscoveredDatabase database, ITableRepository repository, IPa { tbDatabase.Text = $"{_database.GetRuntimeName()}, Version:{repository.GetVersion()}"; } + btnAttemptPatching_Click(null, null); + } private void btnAttemptPatching_Click(object sender, EventArgs e) @@ -68,8 +68,8 @@ private void btnAttemptPatching_Click(object sender, EventArgs e) var mds = new MasterDatabaseScriptExecutor(_database); - mds.PatchDatabase(_patcher, toMem, PreviewPatch, - () => MessageBox.Show("Backup Database First", "Backup", MessageBoxButtons.YesNo) == DialogResult.Yes); + mds.PatchDatabase(_patcher, toMem, (Patch p) => true, + () => false); //if it crashed during patching if (toMem.GetWorst() == CheckResult.Fail) @@ -92,7 +92,7 @@ private void btnAttemptPatching_Click(object sender, EventArgs e) checksUI1.OnCheckPerformed(new CheckEventArgs("Patching Successful", CheckResult.Success, null)); - if (MessageBox.Show("Application will now restart", "Close?", MessageBoxButtons.YesNo) == DialogResult.Yes) + if (MessageBox.Show("Application will now restart", "Restart Application", MessageBoxButtons.OK) == DialogResult.OK) ApplicationRestarter.Restart(); } catch (Exception exception) @@ -106,22 +106,4 @@ public static void ShowIfRequired(DiscoveredDatabase database, ITableRepository if (Patch.IsPatchingRequired(database, patcher, out _, out _, out _) == Patch.PatchingState.Required) new PatchingUI(database, repository, patcher).ShowDialog(); } - - - private bool PreviewPatch(Patch patch) - { - if (_yesToAll) - return true; - - var preview = new SQLPreviewWindow(patch.locationInAssembly, "The following SQL Patch will be run:", - patch.GetScriptBody()); - try - { - return preview.ShowDialog() == DialogResult.OK; - } - finally - { - _yesToAll = preview.YesToAll; - } - } } \ No newline at end of file diff --git a/Rdmp.UI/Wizard/CreateNewCohortIdentificationConfigurationUI.cs b/Rdmp.UI/Wizard/CreateNewCohortIdentificationConfigurationUI.cs index feba8902b6..b0f1c25ed3 100644 --- a/Rdmp.UI/Wizard/CreateNewCohortIdentificationConfigurationUI.cs +++ b/Rdmp.UI/Wizard/CreateNewCohortIdentificationConfigurationUI.cs @@ -5,6 +5,7 @@ // You should have received a copy of the GNU General Public License along with RDMP. If not, see . using System; +using System.ComponentModel; using System.Drawing; using System.Windows.Forms; using Rdmp.Core.CommandExecution.AtomicCommands; @@ -28,6 +29,7 @@ public partial class CreateNewCohortIdentificationConfigurationUI : RDMPForm private Size _smallSize = new(755, 140); private Size _bigSize = new(1368, 876); + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public CohortIdentificationConfiguration CohortIdentificationCriteriaCreatedIfAny { get; private set; } public CreateNewCohortIdentificationConfigurationUI(IActivateItems activator) : base(activator) diff --git a/Rdmp.UI/Wizard/CreateNewDataExtractionProjectUI.cs b/Rdmp.UI/Wizard/CreateNewDataExtractionProjectUI.cs index b32225f90e..5d47ac564f 100644 --- a/Rdmp.UI/Wizard/CreateNewDataExtractionProjectUI.cs +++ b/Rdmp.UI/Wizard/CreateNewDataExtractionProjectUI.cs @@ -5,6 +5,7 @@ // You should have received a copy of the GNU General Public License along with RDMP. If not, see . using System; +using System.ComponentModel; using System.IO; using System.Linq; using System.Windows.Forms; @@ -50,22 +51,23 @@ public partial class CreateNewDataExtractionProjectUI : RDMPForm private bool _bLoading; + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public ExtractionConfiguration ExtractionConfigurationCreatedIfAny { get; private set; } + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public Project ProjectCreatedIfAny { get; private set; } private void GetNextProjectNumber(IActivateItems activator) { - - var AutoSuggestProjectNumbers = false; - var AutoSuggestProjectNumbersSetting = activator.RepositoryLocator.CatalogueRepository.GetAllObjects().Where(s => s.Key == "AutoSuggestProjectNumbers").FirstOrDefault(); - if (AutoSuggestProjectNumbersSetting is not null) AutoSuggestProjectNumbers = Convert.ToBoolean(AutoSuggestProjectNumbersSetting.Value); + var autoSuggestProjectNumbers = false; + var autoSuggestProjectNumbersSetting = activator.RepositoryLocator.CatalogueRepository.GetAllObjects().FirstOrDefault(static s => s.Key == "AutoSuggestProjectNumbers"); + if (autoSuggestProjectNumbersSetting is not null) autoSuggestProjectNumbers = Convert.ToBoolean(autoSuggestProjectNumbersSetting.Value); _existingProjects = activator.RepositoryLocator.DataExportRepository.GetAllObjects(); - if (AutoSuggestProjectNumbers) - { - var highestNumber = _existingProjects.Max(p => p.ProjectNumber); - tbProjectNumber.Text = highestNumber == null ? "1" : (highestNumber.Value + 1).ToString(); - } + if (!autoSuggestProjectNumbers) return; + + var highestNumber = _existingProjects.Max(static p => p.ProjectNumber); + tbProjectNumber.Text = highestNumber == null ? "1" : (highestNumber.Value + 1).ToString(); } public CreateNewDataExtractionProjectUI(IActivateItems activator) : base(activator) diff --git a/Rdmp.UI/Wizard/SimpleFilterUI.cs b/Rdmp.UI/Wizard/SimpleFilterUI.cs index c5239bd561..e680bd9acd 100644 --- a/Rdmp.UI/Wizard/SimpleFilterUI.cs +++ b/Rdmp.UI/Wizard/SimpleFilterUI.cs @@ -6,6 +6,7 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Drawing; using System.Linq; using System.Windows.Forms; @@ -38,6 +39,7 @@ public partial class SimpleFilterUI : UserControl public IFilter Filter => _filter; + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public bool Mandatory { get => _mandatory; diff --git a/SharedAssemblyInfo.cs b/SharedAssemblyInfo.cs index ec5884a345..55f72e959f 100644 --- a/SharedAssemblyInfo.cs +++ b/SharedAssemblyInfo.cs @@ -10,6 +10,6 @@ [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -[assembly: AssemblyVersion("8.4.1")] -[assembly: AssemblyFileVersion("8.4.1")] -[assembly: AssemblyInformationalVersion("8.4.1")] +[assembly: AssemblyVersion("8.4.2")] +[assembly: AssemblyFileVersion("8.4.2")] +[assembly: AssemblyInformationalVersion("8.4.2")] diff --git a/Tests.Common/Tests.Common.csproj b/Tests.Common/Tests.Common.csproj index 31f7f4d586..23b12e1a62 100644 --- a/Tests.Common/Tests.Common.csproj +++ b/Tests.Common/Tests.Common.csproj @@ -3,7 +3,6 @@ HIC.RDMP.Plugin.Test $(version) HIC.RDMP.Plugin.Test - net8.0 Health Informatics Centre, University of Dundee Health Informatics Centre, University of Dundee https://raw.githubusercontent.com/HicServices/RDMP/master/LICENSE diff --git a/Tests.Common/UnitTests.cs b/Tests.Common/UnitTests.cs index ac85ffa74b..2395d65f5f 100644 --- a/Tests.Common/UnitTests.cs +++ b/Tests.Common/UnitTests.cs @@ -124,7 +124,7 @@ protected virtual void SetUp() public static T WhenIHaveA(MemoryDataExportRepository repository) where T : DatabaseEntity { if (typeof(T) == typeof(Catalogue)) - return (T)(object)Save(new Catalogue(repository, "Mycata")); + return Save(new Catalogue(repository, "Mycata")) as T; if (typeof(T) == typeof(ExtendedProperty)) diff --git a/Tools/rdmp/rdmp.csproj b/Tools/rdmp/rdmp.csproj index 0b6e1548b7..ef4f8040be 100644 --- a/Tools/rdmp/rdmp.csproj +++ b/Tools/rdmp/rdmp.csproj @@ -2,7 +2,6 @@ {A6107DDC-8268-4902-A994-233B00480113} Exe - net8.0 true false rdmp diff --git a/global.json b/global.json new file mode 100644 index 0000000000..45f790ca74 --- /dev/null +++ b/global.json @@ -0,0 +1,6 @@ +{ + "sdk": { + "version": "9.0.101", + "rollForward": "minor" + } +} diff --git a/rdmp-client.xml b/rdmp-client.xml index 9157566cec..096919a04c 100644 --- a/rdmp-client.xml +++ b/rdmp-client.xml @@ -1,7 +1,7 @@ - 8.4.1.0 - https://github.com/HicServices/RDMP/releases/download/v8.4.1/rdmp-8.4.1-client.zip + 8.4.2.0 + https://github.com/HicServices/RDMP/releases/download/v8.4.2/rdmp-8.4.2-client.zip https://github.com/HicServices/RDMP/blob/main/CHANGELOG.md#7 true