From 17612c08da93c75d4c941a643bc7602c18f351d8 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Sat, 23 Feb 2019 20:15:36 +0200 Subject: Implemented auto DTO generation. Implemented mapping of DTO <=> Observables. Organization of unit tests. Removed DELETED from ADDRESS & CONTACT. --- .../Visual_Studio/Tango.CodeGeneration/Class.cs | 5 +++ .../Tango.CodeGeneration/EntityCodeFile.cs | 5 --- .../Tango.CodeGeneration/EntityDTOCodeFile.cs | 19 ++++++++++ .../EntityInheritedDTOCodeFile.cs | 23 +++++++++++ .../Visual_Studio/Tango.CodeGeneration/Property.cs | 5 +++ .../Tango.CodeGeneration.csproj | 6 ++- .../Templates/EntityDTOCodeFile.cshtml | 44 ++++++++++++++++++++++ .../Templates/EntityInheritedDTOCodeFile.cshtml | 24 ++++++++++++ 8 files changed, 125 insertions(+), 6 deletions(-) create mode 100644 Software/Visual_Studio/Tango.CodeGeneration/EntityDTOCodeFile.cs create mode 100644 Software/Visual_Studio/Tango.CodeGeneration/EntityInheritedDTOCodeFile.cs create mode 100644 Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityDTOCodeFile.cshtml create mode 100644 Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityInheritedDTOCodeFile.cshtml (limited to 'Software/Visual_Studio/Tango.CodeGeneration') diff --git a/Software/Visual_Studio/Tango.CodeGeneration/Class.cs b/Software/Visual_Studio/Tango.CodeGeneration/Class.cs index 6f1f4f3b9..5a8ea1e74 100644 --- a/Software/Visual_Studio/Tango.CodeGeneration/Class.cs +++ b/Software/Visual_Studio/Tango.CodeGeneration/Class.cs @@ -17,6 +17,11 @@ namespace Tango.CodeGeneration /// public String Name { get; set; } + /// + /// Gets or sets the description. + /// + public String Description { get; set; } + public List InheritsFrom { get; set; } /// diff --git a/Software/Visual_Studio/Tango.CodeGeneration/EntityCodeFile.cs b/Software/Visual_Studio/Tango.CodeGeneration/EntityCodeFile.cs index 9216f5c29..958754a60 100644 --- a/Software/Visual_Studio/Tango.CodeGeneration/EntityCodeFile.cs +++ b/Software/Visual_Studio/Tango.CodeGeneration/EntityCodeFile.cs @@ -27,11 +27,6 @@ namespace Tango.CodeGeneration /// public List Fields { get; set; } - /// - /// Gets or sets the description. - /// - public String Description { get; set; } - /// /// Initializes a new instance of the class. /// diff --git a/Software/Visual_Studio/Tango.CodeGeneration/EntityDTOCodeFile.cs b/Software/Visual_Studio/Tango.CodeGeneration/EntityDTOCodeFile.cs new file mode 100644 index 000000000..eb97dcd90 --- /dev/null +++ b/Software/Visual_Studio/Tango.CodeGeneration/EntityDTOCodeFile.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.CodeGeneration +{ + /// + /// Represents a database entity DTO code file. + /// + /// + public class EntityDTOCodeFile : Class + { + public String ObservableType { get; set; } + + public String InheritedType { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.CodeGeneration/EntityInheritedDTOCodeFile.cs b/Software/Visual_Studio/Tango.CodeGeneration/EntityInheritedDTOCodeFile.cs new file mode 100644 index 000000000..297050d69 --- /dev/null +++ b/Software/Visual_Studio/Tango.CodeGeneration/EntityInheritedDTOCodeFile.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.CodeGeneration +{ + /// + /// Represents a database entity DTO code file. + /// + /// + public class EntityInheritedDTOCodeFile : Class + { + public String BaseClass { get; set; } + + public EntityInheritedDTOCodeFile(String name, String baseClass) + { + Name = name; + BaseClass = baseClass; + } + } +} diff --git a/Software/Visual_Studio/Tango.CodeGeneration/Property.cs b/Software/Visual_Studio/Tango.CodeGeneration/Property.cs index d7ca5f4a8..cb27ca2a4 100644 --- a/Software/Visual_Studio/Tango.CodeGeneration/Property.cs +++ b/Software/Visual_Studio/Tango.CodeGeneration/Property.cs @@ -22,6 +22,11 @@ namespace Tango.CodeGeneration /// public String Type { get; set; } + /// + /// Gets or sets the property description. + /// + public String Description { get; set; } + /// /// Gets or sets the property setter modifier. /// diff --git a/Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj b/Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj index 98c063a86..a3b02afd5 100644 --- a/Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj +++ b/Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj @@ -65,6 +65,8 @@ + + @@ -120,11 +122,13 @@ + + - +