Add converting strategies for beam shear actions
This commit is contained in:
@@ -1,12 +1,6 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperCommon.Models.Loggers;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DataAccess.DTOs
|
||||
{
|
||||
@@ -24,11 +18,33 @@ namespace DataAccess.DTOs
|
||||
|
||||
}
|
||||
|
||||
public ForceTupleToDTOConvertStrategy(Dictionary<(Guid id, Type type), ISaveable> referenceDictionary, IShiftTraceLogger traceLogger)
|
||||
: base(referenceDictionary, traceLogger)
|
||||
{
|
||||
}
|
||||
|
||||
public override ForceTupleDTO GetNewItem(IForceTuple source)
|
||||
{
|
||||
ForceTupleDTO newItem = new(source.Id);
|
||||
updateStrategy.Update(newItem, source);
|
||||
return newItem;
|
||||
try
|
||||
{
|
||||
GetNewBeamForceTuple(source);
|
||||
return NewItem;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
TraceErrorByEntity(this, ex.Message);
|
||||
throw;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void GetNewBeamForceTuple(IForceTuple source)
|
||||
{
|
||||
TraceLogger?.AddMessage($"Converting of force tuple Id = {source.Id} has been started", TraceLogStatuses.Debug);
|
||||
updateStrategy ??= new ForceTupleUpdateStrategy();
|
||||
NewItem = new(source.Id);
|
||||
updateStrategy.Update(NewItem, source);
|
||||
TraceLogger?.AddMessage($"Converting of force tuple Id = {source.Id} has been finished", TraceLogStatuses.Debug);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user