Add converting beam shear analysis from DTOs
This commit is contained in:
@@ -1,29 +1,25 @@
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DataAccess.DTOs
|
||||
{
|
||||
public class ForceTupleFromDTOConvertStrategy : ConvertStrategy<ForceTuple, ForceTupleDTO>
|
||||
{
|
||||
private readonly IUpdateStrategy<IForceTuple> updateStrategy;
|
||||
private IUpdateStrategy<IForceTuple> updateStrategy;
|
||||
|
||||
public ForceTupleFromDTOConvertStrategy(IUpdateStrategy<IForceTuple> updateStrategy)
|
||||
public ForceTupleFromDTOConvertStrategy()
|
||||
{
|
||||
this.updateStrategy = updateStrategy;
|
||||
}
|
||||
|
||||
public ForceTupleFromDTOConvertStrategy() : this(new ForceTupleUpdateStrategy())
|
||||
public ForceTupleFromDTOConvertStrategy(Dictionary<(Guid id, Type type), ISaveable> referenceDictionary, IShiftTraceLogger traceLogger)
|
||||
: base(referenceDictionary, traceLogger)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override ForceTuple GetNewItem(ForceTupleDTO source)
|
||||
{
|
||||
updateStrategy ??= new ForceTupleUpdateStrategy();
|
||||
ForceTuple newItem = new(source.Id);
|
||||
updateStrategy.Update(newItem, source);
|
||||
return newItem;
|
||||
|
||||
Reference in New Issue
Block a user