Add materials converting from DTOs
This commit is contained in:
@@ -10,14 +10,13 @@ namespace StructureHelperCommon.Models.Materials.Libraries
|
||||
{
|
||||
public class MaterialSafetyFactorUpdateStrategy : IUpdateStrategy<IMaterialSafetyFactor>
|
||||
{
|
||||
private IUpdateStrategy<IMaterialSafetyFactor> baseUpdateStrategy = new MaterialSafetyFactorBaseUpdateStrategy();
|
||||
public void Update(IMaterialSafetyFactor targetObject, IMaterialSafetyFactor sourceObject)
|
||||
{
|
||||
CheckObject.IsNull(sourceObject);
|
||||
CheckObject.IsNull(targetObject);
|
||||
if (ReferenceEquals(targetObject, sourceObject)) { return; }
|
||||
targetObject.Name = sourceObject.Name;
|
||||
targetObject.Take = sourceObject.Take;
|
||||
targetObject.Description = sourceObject.Description;
|
||||
baseUpdateStrategy.Update(targetObject, sourceObject);
|
||||
targetObject.PartialFactors.Clear();
|
||||
foreach (var item in sourceObject.PartialFactors)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user