Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Application.Ringtoets.Storage.csproj =================================================================== diff -u -re7acba10209b18e88bf89d9211f6fc031d0f992e -ra65bc56647a666fad39e7fe48fbce3a5c040dfee --- Application/Ringtoets/src/Application.Ringtoets.Storage/Application.Ringtoets.Storage.csproj (.../Application.Ringtoets.Storage.csproj) (revision e7acba10209b18e88bf89d9211f6fc031d0f992e) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Application.Ringtoets.Storage.csproj (.../Application.Ringtoets.Storage.csproj) (revision a65bc56647a666fad39e7fe48fbce3a5c040dfee) @@ -38,6 +38,7 @@ + ..\..\..\..\packages\System.Data.SQLite.Core.1.0.99.0\lib\net40\System.Data.SQLite.dll True @@ -46,9 +47,6 @@ ..\..\..\..\packages\System.Data.SQLite.EF6.1.0.99.0\lib\net40\System.Data.SQLite.EF6.dll True - - - Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Persistors/IPersistor.cs =================================================================== diff -u -re7acba10209b18e88bf89d9211f6fc031d0f992e -ra65bc56647a666fad39e7fe48fbce3a5c040dfee --- Application/Ringtoets/src/Application.Ringtoets.Storage/Persistors/IPersistor.cs (.../IPersistor.cs) (revision e7acba10209b18e88bf89d9211f6fc031d0f992e) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Persistors/IPersistor.cs (.../IPersistor.cs) (revision a65bc56647a666fad39e7fe48fbce3a5c040dfee) @@ -38,7 +38,6 @@ /// Collection where objects can be searched and added. Usually, this collection is a navigation property of a . /// The to be saved in the storage. /// Value used for sorting. - //void UpdateModels(ICollection parentNavigationProperty, IEnumerable listOfModels); void UpdateModel(ICollection parentNavigationProperty, TModel model, int order); /// @@ -48,7 +47,6 @@ /// Collection where objects can be added. Usually, this collection is a navigation property of a . /// The to be saved in the storage. /// Value used for sorting. - //void InsertModels(ICollection parentNavigationProperty, IEnumerable listOfModels); void InsertModel(ICollection parentNavigationProperty, TModel model, int order); /// Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Persistors/ProjectEntityPersistor.cs =================================================================== diff -u -r46f39b6003e678cb2fa3add0365f78f09701cf63 -ra65bc56647a666fad39e7fe48fbce3a5c040dfee --- Application/Ringtoets/src/Application.Ringtoets.Storage/Persistors/ProjectEntityPersistor.cs (.../ProjectEntityPersistor.cs) (revision 46f39b6003e678cb2fa3add0365f78f09701cf63) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Persistors/ProjectEntityPersistor.cs (.../ProjectEntityPersistor.cs) (revision a65bc56647a666fad39e7fe48fbce3a5c040dfee) @@ -36,7 +36,7 @@ /// /// Persistor for . /// - public class ProjectEntityPersistor // : IPersistor + public class ProjectEntityPersistor { private readonly IRingtoetsEntities dbContext; private readonly IDbSet dbSet; @@ -87,7 +87,9 @@ { project.Items.Add(section); } - + } + if (entry.DuneAssessmentSectionEntities.Count > 0) + { var duneList = duneAssessmentSectionEntityPersistor.LoadModels(entry.DuneAssessmentSectionEntities); foreach (var section in duneList) { @@ -102,9 +104,7 @@ /// Insert the , based upon the , in the sequence. /// /// Execute afterwards to update the storage. - /// /// to be inserted in the sequence. - /// Value used for sorting (not used in in ). /// New instance of . /// Thrown when is null. /// The parentNavigationProperty is read-only. @@ -170,7 +170,6 @@ /// Removes all entities from that are not marked as 'updated'. /// /// List where objects can be searched. Usually, this collection is a navigation property of a . - /// Number of entities removed. /// Thrown when the is read-only. public void RemoveUnModifiedEntries(ICollection parentNavigationProperty) { Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Application.Ringtoets.Storage.Test.csproj =================================================================== diff -u -re7acba10209b18e88bf89d9211f6fc031d0f992e -ra65bc56647a666fad39e7fe48fbce3a5c040dfee --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Application.Ringtoets.Storage.Test.csproj (.../Application.Ringtoets.Storage.Test.csproj) (revision e7acba10209b18e88bf89d9211f6fc031d0f992e) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Application.Ringtoets.Storage.Test.csproj (.../Application.Ringtoets.Storage.Test.csproj) (revision a65bc56647a666fad39e7fe48fbce3a5c040dfee) @@ -46,9 +46,6 @@ ..\..\..\..\packages\Fluent.Ribbon.3.4.0\lib\net40\Fluent.dll - - ..\..\..\..\packages\Fluent.Ribbon.3.4.0\lib\net40\Microsoft.Windows.Shell.dll - ..\..\..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll True @@ -71,9 +68,6 @@ True - - ..\..\..\..\packages\Fluent.Ribbon.3.4.0\lib\net40\System.Windows.Interactivity.dll - Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/DbContext/DikeAssessmentSectionEntityTest.cs =================================================================== diff -u -re7acba10209b18e88bf89d9211f6fc031d0f992e -ra65bc56647a666fad39e7fe48fbce3a5c040dfee --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/DbContext/DikeAssessmentSectionEntityTest.cs (.../DikeAssessmentSectionEntityTest.cs) (revision e7acba10209b18e88bf89d9211f6fc031d0f992e) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/DbContext/DikeAssessmentSectionEntityTest.cs (.../DikeAssessmentSectionEntityTest.cs) (revision a65bc56647a666fad39e7fe48fbce3a5c040dfee) @@ -28,6 +28,7 @@ const string someName = ""; const int someNorm = 5000; + // Call var dikeAssessmentSectionEntity = new DikeAssessmentSectionEntity { ProjectEntityId = expectedParentId, @@ -36,7 +37,7 @@ Norm = someNorm }; - // Call & Assert + // Assert Assert.AreEqual(expectedParentId, dikeAssessmentSectionEntity.ProjectEntityId); Assert.AreEqual(expectedId, dikeAssessmentSectionEntity.DikeAssessmentSectionEntityId); Assert.AreEqual(someName, dikeAssessmentSectionEntity.Name); Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/DbContext/DuneAssessmentSectionEntityTest.cs =================================================================== diff -u -re7acba10209b18e88bf89d9211f6fc031d0f992e -ra65bc56647a666fad39e7fe48fbce3a5c040dfee --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/DbContext/DuneAssessmentSectionEntityTest.cs (.../DuneAssessmentSectionEntityTest.cs) (revision e7acba10209b18e88bf89d9211f6fc031d0f992e) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/DbContext/DuneAssessmentSectionEntityTest.cs (.../DuneAssessmentSectionEntityTest.cs) (revision a65bc56647a666fad39e7fe48fbce3a5c040dfee) @@ -28,6 +28,7 @@ const string someName = ""; const int someNorm = 5000; + // Call var duneAssessmentSectionEntity = new DuneAssessmentSectionEntity { ProjectEntityId = expectedParentId, @@ -36,7 +37,7 @@ Norm = someNorm }; - // Call & Assert + // Assert Assert.AreEqual(expectedParentId, duneAssessmentSectionEntity.ProjectEntityId); Assert.AreEqual(expectedId, duneAssessmentSectionEntity.DuneAssessmentSectionEntityId); Assert.AreEqual(someName, duneAssessmentSectionEntity.Name); Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/IntegrationTests/StorageSqLiteIntegrationTest.cs =================================================================== diff -u -r46f39b6003e678cb2fa3add0365f78f09701cf63 -ra65bc56647a666fad39e7fe48fbce3a5c040dfee --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/IntegrationTests/StorageSqLiteIntegrationTest.cs (.../StorageSqLiteIntegrationTest.cs) (revision 46f39b6003e678cb2fa3add0365f78f09701cf63) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/IntegrationTests/StorageSqLiteIntegrationTest.cs (.../StorageSqLiteIntegrationTest.cs) (revision a65bc56647a666fad39e7fe48fbce3a5c040dfee) @@ -15,29 +15,7 @@ { private readonly string testDataPath = TestHelper.GetTestDataPath(TestDataPath.Application.Ringtoets.Storage, "DatabaseFiles"); private readonly string tempRingtoetsFile = Path.Combine(TestHelper.GetTestDataPath(TestDataPath.Application.Ringtoets.Storage, "DatabaseFiles"), "tempProjectFile.rtd"); - private Project fullProject; - [SetUp] - public void Setup() - { - fullProject = new Project() - { - Name = "tempProjectFile", - Description = "description", - Items = - { - new DikeAssessmentSection - { - Name = "dikeAssessmentSection" - }, - new DuneAssessmentSection - { - Name = "duneAssessmentSection" - } - } - }; - } - [TestFixtureTearDown] [TearDown] public void TearDownTempRingtoetsFile() @@ -49,6 +27,7 @@ public void SaveProjectAs_SaveAsNewFile_ProjectAsEntitiesInBothFiles() { // Setup + Project fullProject = GetFullProject(); var tempFile = Path.Combine(testDataPath, "tempProjectAsFile.rtd"); StorageSqLite storage = new StorageSqLite(); @@ -102,6 +81,7 @@ { // Setup StorageSqLite storage = new StorageSqLite(); + Project fullProject = GetFullProject(); TestDelegate precondition = () => storage.SaveProjectAs(tempRingtoetsFile, fullProject); Assert.DoesNotThrow(precondition, String.Format("Precondition: file '{0}' must be a valid Ringtoets database file.", tempRingtoetsFile)); @@ -207,6 +187,26 @@ } } + private static Project GetFullProject() + { + return new Project() + { + Name = "tempProjectFile", + Description = "description", + Items = + { + new DikeAssessmentSection + { + Name = "dikeAssessmentSection" + }, + new DuneAssessmentSection + { + Name = "duneAssessmentSection" + } + } + }; + } + private void TearDownTempRingtoetsFile(string filePath) { GC.Collect(); Index: Core/Common/src/Core.Common.Base/Storage/IStoreProject.cs =================================================================== diff -u -rfbb37872d09f1ded75ce2209e8e48a6b64d8a78f -ra65bc56647a666fad39e7fe48fbce3a5c040dfee --- Core/Common/src/Core.Common.Base/Storage/IStoreProject.cs (.../IStoreProject.cs) (revision fbb37872d09f1ded75ce2209e8e48a6b64d8a78f) +++ Core/Common/src/Core.Common.Base/Storage/IStoreProject.cs (.../IStoreProject.cs) (revision a65bc56647a666fad39e7fe48fbce3a5c040dfee) @@ -19,6 +19,7 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; using Core.Common.Base.Data; namespace Core.Common.Base.Storage @@ -52,6 +53,8 @@ /// /// The to save. /// Returns the number of changes that were saved. + /// Thrown when is null. + /// is invalid. /// Thrown when /// /// does not exist. @@ -69,9 +72,14 @@ /// Arguments required to connect to the storage. /// Returns a new instance of with the data from the storage or null when not found. /// is invalid. - /// Thrown when no new storage was created. - /// Thrown when updating the storage fails. - /// Thrown when the storage is no valid Ringtoets project. + /// Thrown when + /// + /// is invalid. + /// The storage does not contain all requested tables. + /// The connection to the storage failed. + /// The related entity was not found in the storage. + /// + /// Project LoadProject(string connectionArguments); } } \ No newline at end of file Index: Ringtoets.sln =================================================================== diff -u -r3167b898b071fea4cf86c775bca5467fab086038 -ra65bc56647a666fad39e7fe48fbce3a5c040dfee --- Ringtoets.sln (.../Ringtoets.sln) (revision 3167b898b071fea4cf86c775bca5467fab086038) +++ Ringtoets.sln (.../Ringtoets.sln) (revision a65bc56647a666fad39e7fe48fbce3a5c040dfee) @@ -834,7 +834,6 @@ {209AC67F-DCFA-4355-B45A-9D9A2E4593D2} = {FE36E7E0-D5F7-48E3-9730-D05443351EAD} {39EB5D07-C076-484C-9621-B34C4E5BF64C} = {85F88AB0-CA03-48D3-B5A0-DF0848C24AB0} {EE8D5A6C-4871-452A-A69B-F04E374D715E} = {85F88AB0-CA03-48D3-B5A0-DF0848C24AB0} - {C90B77DA-E421-43CC-B82E-529651BC21AC} = {8261CCE1-98D7-465B-BC94-4ED239DE7F2E} {F49BD8B2-332A-4C91-A196-8CCE0A2C7D98} = {8261CCE1-98D7-465B-BC94-4ED239DE7F2E} {30E4C2AE-719E-4D70-9FA9-668A9767FBFA} = {8261CCE1-98D7-465B-BC94-4ED239DE7F2E} {3BBFD65B-B277-4E50-AE6D-BD24C3434609} = {8261CCE1-98D7-465B-BC94-4ED239DE7F2E} @@ -850,6 +849,7 @@ {A8CE1456-1880-4FC8-84B3-D618EA88F384} = {0D9858E1-CF2D-4DE5-AC0E-64401900D531} {FAF691DE-EAF5-44E0-A865-5A03FB395ED1} = {0D9858E1-CF2D-4DE5-AC0E-64401900D531} {0EDC6D7D-E9CD-408A-9EA9-3E7D426809C8} = {0D9858E1-CF2D-4DE5-AC0E-64401900D531} + {C90B77DA-E421-43CC-B82E-529651BC21AC} = {0D9858E1-CF2D-4DE5-AC0E-64401900D531} {93E73FAB-FAE8-49C6-9ABB-27D24DF761F6} = {4B4F0984-5730-4E28-93E7-DDE0F29BA550} {ED20DBA9-D577-423F-A68D-A0A8130FB10B} = {4B4F0984-5730-4E28-93E7-DDE0F29BA550} {4163B996-3455-4324-A38A-9F2F0E6FCB52} = {4B4F0984-5730-4E28-93E7-DDE0F29BA550}