Material Update Strategy was added

This commit is contained in:
Evgeny Redikultsev
2023-07-02 22:03:30 +05:00
parent 2595d7e733
commit 03b882f54d
74 changed files with 456 additions and 184 deletions

View File

@@ -0,0 +1,23 @@
using StructureHelperCommon.Infrastructures.Interfaces;
using StructureHelperCommon.Models.Materials.Libraries;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.Models.Materials
{
internal class LibMaterialUpdateStrategy : IUpdateStrategy<ILibMaterial>
{
public void Update(ILibMaterial targetObject, ILibMaterial sourceObject)
{
targetObject.MaterialEntity = sourceObject.MaterialEntity;
targetObject.SafetyFactors.Clear();
foreach (var item in sourceObject.SafetyFactors)
{
targetObject.SafetyFactors.Add(item.Clone() as IMaterialSafetyFactor);
}
}
}
}