Add project ConvertFromStrategy

This commit is contained in:
Evgeny Redikultsev
2024-10-20 20:01:32 +05:00
parent d3a1992f4d
commit b0c24126da
28 changed files with 457 additions and 75 deletions

View File

@@ -11,7 +11,7 @@ namespace DataAccess.DTOs.DTOEntities
public class AccuracyDTO : IAccuracy
{
[JsonProperty("Id")]
public Guid Id { get; set; }
public Guid Id { get; set; } = Guid.NewGuid();
[JsonProperty("IterationAccuracy")]
public double IterationAccuracy { get; set; }
[JsonProperty("MaxIterationCount")]

View File

@@ -18,6 +18,7 @@ namespace DataAccess.DTOs
{
const MaterialTypes materialType = MaterialTypes.Concrete;
[JsonProperty("Id")]
public Guid Id { get; set; }
[JsonProperty("RelativeHumidity")]
@@ -29,7 +30,11 @@ namespace DataAccess.DTOs
[JsonProperty("MaterialEntityId")]
public Guid MaterialEntityId
{
get => MaterialEntity.Id;
get
{
return MaterialEntity.Id;
}
set
{
MaterialEntity = ProgramSetting.MaterialRepository.Repository.Single(x => x.Id == value);

View File

@@ -8,7 +8,7 @@ namespace DataAccess.DTOs
public class CrackCalculatorInputDataDTO : ICrackCalculatorInputData
{
[JsonProperty("Id")]
public Guid Id { get; set; }
public Guid Id { get; set; } = Guid.NewGuid();
[JsonProperty("ForceActions")]
public List<IForceAction> ForceActions { get; set; } = new();
[JsonProperty("ForcePrimitives")]

View File

@@ -1,6 +1,8 @@
using Newtonsoft.Json;
using StructureHelperCommon.Infrastructures.Interfaces;
using StructureHelperCommon.Models.Analyses;
using StructureHelperLogic.Models.Analyses;
using StructureHelperLogics.Models.Analyses;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -22,7 +24,7 @@ namespace DataAccess.DTOs
public object Clone()
{
throw new NotImplementedException();
return this;
}
}
}

View File

@@ -23,5 +23,9 @@ namespace DataAccess.DTOs
{
Id = id;
}
public FileVersionDTO() : this (Guid.NewGuid())
{
}
}
}

View File

@@ -0,0 +1,16 @@
using StructureHelperCommon.Infrastructures.Interfaces;
using StructureHelperCommon.Models.Projects;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DataAccess.DTOs
{
public interface IRootObjectDTO
{
FileVersionDTO FileVersion { get; set; }
ProjectDTO Project { get; set; }
}
}

View File

@@ -1,4 +1,5 @@
using Newtonsoft.Json;
using StructureHelperCommon.Infrastructures.Interfaces;
using StructureHelperCommon.Models.Analyses;
using StructureHelperCommon.Models.Projects;
using System;

View File

@@ -0,0 +1,19 @@
using Newtonsoft.Json;
using StructureHelperCommon.Models.Projects;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DataAccess.DTOs
{
public class RootObjectDTO : IRootObjectDTO
{
[JsonProperty("FileVersion")]
public FileVersionDTO FileVersion { get; set; }
[JsonProperty("Project")]
public ProjectDTO Project { get; set; }
}
}

View File

@@ -81,6 +81,7 @@ namespace DataAccess.DTOs
{ (typeof(RectangleNdmPrimitiveDTO), "RectangleNdmPrimitive") },
{ (typeof(RectangleShapeDTO), "RectangleShape") },
{ (typeof(ReinforcementLibMaterialDTO), "ReinforcementLibMaterial") },
{ (typeof(RootObjectDTO), "RootObject") },
{ (typeof(MaterialPartialFactorDTO), "MaterialPartialFactor") },
{ (typeof(VersionProcessorDTO), "VersionProcessor") },
{ (typeof(VisualAnalysisDTO), "VisualAnalysis") },

View File

@@ -11,7 +11,7 @@ namespace DataAccess.DTOs
public class UserCrackInputDataDTO : IUserCrackInputData
{
[JsonProperty("Id")]
public Guid Id { get; set; }
public Guid Id { get; set; } = Guid.NewGuid();
[JsonProperty("LengthBetweenCracks")]
public double LengthBetweenCracks { get; set; }
[JsonProperty("SetLengthBetweenCracks")]

View File

@@ -1,4 +1,5 @@
using Newtonsoft.Json;
using StructureHelperCommon.Infrastructures.Interfaces;
using StructureHelperCommon.Models.Analyses;
using System;
using System.Collections.Generic;
@@ -10,15 +11,17 @@ namespace DataAccess.DTOs
{
public class VisualAnalysisDTO : IVisualAnalysis
{
[JsonProperty("Id")]
public Guid Id { get; set; }
[JsonProperty("Analysis")]
public IAnalysis Analysis { get; set; }
[JsonIgnore]
public Action ActionToRun { get; set; }
public object Clone()
{
throw new NotImplementedException();
return this;
}
public void Run()