Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Create/FailureMechanismBaseCreateExtensions.cs
===================================================================
diff -u -r64d5609bb2912cd52dc74deffdd189222e240599 -r209bfd7b71ef53a57e1a52337f1333d38122282f
--- Application/Ringtoets/src/Application.Ringtoets.Storage/Create/FailureMechanismBaseCreateExtensions.cs (.../FailureMechanismBaseCreateExtensions.cs) (revision 64d5609bb2912cd52dc74deffdd189222e240599)
+++ Application/Ringtoets/src/Application.Ringtoets.Storage/Create/FailureMechanismBaseCreateExtensions.cs (.../FailureMechanismBaseCreateExtensions.cs) (revision 209bfd7b71ef53a57e1a52337f1333d38122282f)
@@ -22,6 +22,7 @@
using System;
using Application.Ringtoets.Storage.DbContext;
using Ringtoets.Common.Data.FailureMechanism;
+using Ringtoets.Integration.Data.StandAlone;
namespace Application.Ringtoets.Storage.Create
{
@@ -31,6 +32,33 @@
internal static class FailureMechanismBaseCreateExtensions
{
///
+ /// Creates a based on the information of the .
+ ///
+ /// The failure mechanism to create a database entity for.
+ /// The type of the failure mechanism that is being created.
+ /// The object keeping track of create operations.
+ /// A new .
+ /// Thrown when is null.
+ internal static FailureMechanismEntity Create(this IFailureMechanism mechanism, FailureMechanismType type, CreateConversionCollector collector)
+ {
+ if (collector == null)
+ {
+ throw new ArgumentNullException("collector");
+ }
+
+ FailureMechanismEntity entity = new FailureMechanismEntity
+ {
+ FailureMechanismType = (short)type,
+ IsRelevant = Convert.ToByte(mechanism.IsRelevant)
+ };
+
+ mechanism.AddEntitiesForFailureMechanismSections(collector, entity);
+
+ collector.Create(entity, mechanism);
+ return entity;
+ }
+
+ ///
/// Creates instances based on the information of the .
///
/// The failure mechanism to create a database failure mechanism section entities for.