Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Converters/ProjectEntityConverter.cs
===================================================================
diff -u -r4512af7782ee31b36941bb280b54d9da2953dd71 -rbd8a3e95f0145815fa6724a162404a76c9dc9f5a
--- Application/Ringtoets/src/Application.Ringtoets.Storage/Converters/ProjectEntityConverter.cs (.../ProjectEntityConverter.cs) (revision 4512af7782ee31b36941bb280b54d9da2953dd71)
+++ Application/Ringtoets/src/Application.Ringtoets.Storage/Converters/ProjectEntityConverter.cs (.../ProjectEntityConverter.cs) (revision bd8a3e95f0145815fa6724a162404a76c9dc9f5a)
@@ -35,20 +35,25 @@
/// Converts to .
///
/// The to convert.
+ /// The to obtain the model.
/// A new instance of , based on the properties of .
- /// Thrown when is null.
- public Project ConvertEntityToModel(ProjectEntity entity)
+ /// Thrown when or is null.
+ public Project ConvertEntityToModel(ProjectEntity entity, Func model)
{
if (entity == null)
{
throw new ArgumentNullException("entity");
}
- var project = new Project
+
+ if (model() == null)
{
- StorageId = entity.ProjectEntityId,
- Description = entity.Description
- };
+ throw new ArgumentNullException("model");
+ }
+ var project = model();
+ project.StorageId = entity.ProjectEntityId;
+ project.Description = entity.Description;
+
return project;
}