Add EllipsePrimitive to DTO Converter

This commit is contained in:
Evgeny Redikultsev
2024-10-13 17:31:18 +05:00
parent 7e54aa0407
commit d16c0e1f79
54 changed files with 605 additions and 62 deletions

View File

@@ -0,0 +1,31 @@
using StructureHelperCommon.Infrastructures.Interfaces;
using StructureHelperCommon.Models;
using StructureHelperCommon.Models.Shapes;
namespace DataAccess.DTOs
{
public class RectangleShapeToDTOConvertStrategy : IConvertStrategy<RectangleShapeDTO, IRectangleShape>
{
private IUpdateStrategy<IRectangleShape> updateStrategy;
public RectangleShapeToDTOConvertStrategy(IUpdateStrategy<IRectangleShape> updateStrategy)
{
this.updateStrategy = updateStrategy;
}
public RectangleShapeToDTOConvertStrategy() : this (new RectangleShapeUpdateStrategy())
{
}
public Dictionary<(Guid id, Type type), ISaveable> ReferenceDictionary { get; set; }
public IShiftTraceLogger TraceLogger { get; set; }
public RectangleShapeDTO Convert(IRectangleShape source)
{
RectangleShapeDTO newItem = new() { Id = source.Id};
updateStrategy.Update(newItem, source);
return newItem;
}
}
}