Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Create/StructuresOutputCreateExtensions.cs
===================================================================
diff -u -r4ad65cef966ec4b0e6f36b7a612aef4bdd088837 -r699aed8b7cadb16fa905b2e54c8174d0d5747b99
--- Application/Ringtoets/src/Application.Ringtoets.Storage/Create/StructuresOutputCreateExtensions.cs (.../StructuresOutputCreateExtensions.cs) (revision 4ad65cef966ec4b0e6f36b7a612aef4bdd088837)
+++ Application/Ringtoets/src/Application.Ringtoets.Storage/Create/StructuresOutputCreateExtensions.cs (.../StructuresOutputCreateExtensions.cs) (revision 699aed8b7cadb16fa905b2e54c8174d0d5747b99)
@@ -19,6 +19,7 @@
// Stichting Deltares and remain full property of Stichting Deltares at all times.
// All rights reserved.
+using System;
using Application.Ringtoets.Storage.Create.IllustrationPoints;
using Application.Ringtoets.Storage.DbContext;
using Ringtoets.Common.Data.Probability;
@@ -34,29 +35,36 @@
{
///
/// Creates a based on the information of the
- /// .
+ /// .
///
- /// The calculation output to create a database entity for.
+ /// The structures output to create a database entity for.
/// A new .
- public static TOutputEntity Create(this StructuresOutput calculationOutput)
+ /// Thrown when
+ /// is null.
+ public static TOutputEntity Create(this StructuresOutput structuresOutput)
where TOutputEntity : IProbabilityAssessmentOutputEntity,
IHasGeneralResultFaultTreeIllustrationPointEntity,
new()
{
- ProbabilityAssessmentOutput probabilityAssessmentOutput = calculationOutput.ProbabilityAssessmentOutput;
+ if (structuresOutput == null)
+ {
+ throw new ArgumentNullException(nameof(structuresOutput));
+ }
+
+ ProbabilityAssessmentOutput probabilityAssessmentOutput = structuresOutput.ProbabilityAssessmentOutput;
var outputEntity = probabilityAssessmentOutput.Create();
- SetGeneralResult(calculationOutput, outputEntity);
+ SetGeneralResult(structuresOutput, outputEntity);
return outputEntity;
}
- private static void SetGeneralResult(StructuresOutput calculationOutput, IHasGeneralResultFaultTreeIllustrationPointEntity outputEntity)
+ private static void SetGeneralResult(StructuresOutput structuresOutput, IHasGeneralResultFaultTreeIllustrationPointEntity outputEntity)
{
- if (calculationOutput.HasGeneralResult)
+ if (structuresOutput.HasGeneralResult)
{
outputEntity.GeneralResultFaultTreeIllustrationPointEntity =
- calculationOutput.GeneralResult
+ structuresOutput.GeneralResult
.CreateGeneralResultFaultTreeIllustrationPointEntity();
}
}