Add work plane property saving

This commit is contained in:
Evgeny Redikultsev
2025-01-25 19:21:34 +05:00
parent bbc6ade283
commit 3a946a29bc
37 changed files with 765 additions and 324 deletions

View File

@@ -19,10 +19,10 @@ namespace DataAccess.DTOs
this.materialConvertStrategy = materialConvertStrategy;
}
public CrossSectionRepositoryToDTOConvertStrategy() : this(
new HeadMaterialToDTOConvertStrategy())
public CrossSectionRepositoryToDTOConvertStrategy(Dictionary<(Guid id, Type type), ISaveable> referenceDictionary, IShiftTraceLogger traceLogger)
{
ReferenceDictionary = referenceDictionary;
TraceLogger = traceLogger;
}
public Dictionary<(Guid id, Type type), ISaveable> ReferenceDictionary { get; set; }
@@ -31,6 +31,7 @@ namespace DataAccess.DTOs
public CrossSectionRepositoryDTO Convert(ICrossSectionRepository source)
{
Check();
InitializeStrategies();
try
{
CrossSectionRepositoryDTO newItem = GetNewRepository(source);
@@ -44,6 +45,11 @@ namespace DataAccess.DTOs
}
}
private void InitializeStrategies()
{
materialConvertStrategy ??= new HeadMaterialToDTOConvertStrategy();
}
private CrossSectionRepositoryDTO GetNewRepository(ICrossSectionRepository source)
{
CrossSectionRepositoryDTO newItem = new()