Fix error of cross-section cloning strategy

This commit is contained in:
Evgeny Redikultsev
2024-12-29 20:32:48 +05:00
parent bd0175086a
commit ba70e0d214
8 changed files with 42 additions and 31 deletions

View File

@@ -9,7 +9,7 @@ namespace StructureHelperLogics.Models.CrossSections
{
public class CrossSection : ICrossSection
{
private ICloneStrategy<ICrossSection> cloneStrategy = new CrossSectionCloneStrategy();
private ICloneStrategy<ICrossSection> cloneStrategy;
private IUpdateStrategy<ICrossSection> updateStrategy = new CrossSectionUpdateStrategy();
public ICrossSectionRepository SectionRepository { get; set; } = new CrossSectionRepository();
@@ -27,9 +27,7 @@ namespace StructureHelperLogics.Models.CrossSections
public object Clone()
{
//var newItem = new CrossSection();
//updateStrategy.Update(newItem, this);
//return newItem;
cloneStrategy = new CrossSectionCloneStrategy();
return cloneStrategy.GetClone(this);
}
}