Add materials converting from DTOs

This commit is contained in:
Evgeny Redikultsev
2024-10-27 21:29:50 +05:00
parent b0c24126da
commit 223e69263f
71 changed files with 1398 additions and 253 deletions

View File

@@ -6,7 +6,7 @@ using StructureHelperCommon.Models.Loggers;
namespace DataAccess.DTOs.Converters
{
public class ForceActionToDTOConvertStrategy : IConvertStrategy<IForceAction, IForceAction>
public class ForceActionToDTOConvertStrategy : ConvertStrategy<IForceAction, IForceAction>
{
private IConvertStrategy<ForceCombinationByFactorDTO, IForceCombinationByFactor> forceCombinationByFactorConvertStrategy;
private IConvertStrategy<ForceCombinationListDTO, IForceCombinationList> forceCombinationListConvertStrategy;
@@ -26,24 +26,7 @@ namespace DataAccess.DTOs.Converters
}
public Dictionary<(Guid id, Type type), ISaveable> ReferenceDictionary { get; set; }
public IShiftTraceLogger TraceLogger { get; set; }
public IForceAction Convert(IForceAction source)
{
try
{
return ProcessForceAction(source);
}
catch (Exception ex)
{
TraceLogger?.AddMessage(LoggerStrings.LogicType(this), TraceLogStatuses.Error);
TraceLogger?.AddMessage(ex.Message, TraceLogStatuses.Error);
throw;
}
}
private IForceAction ProcessForceAction(IForceAction source)
public override IForceAction GetNewItem(IForceAction source)
{
if (source is IForceCombinationByFactor forceCombinationByFactor)
{