From 5d795170b304199383ac967583830acaf313ff05 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Tue, 10 Jul 2018 15:24:06 +0300 Subject: Some work on PPC. Implemented retrieval of column description for auto generated observables & pmr's. --- .../Tango.CodeGeneration/EntityCodeFile.cs | 7 +++++++ .../Tango.CodeGeneration/ProtoProperty.cs | 5 +++++ .../Templates/EntityCodeFile.cshtml | 21 +++++++++++++++++++++ 3 files changed, 33 insertions(+) (limited to 'Software/Visual_Studio/Tango.CodeGeneration') diff --git a/Software/Visual_Studio/Tango.CodeGeneration/EntityCodeFile.cs b/Software/Visual_Studio/Tango.CodeGeneration/EntityCodeFile.cs index fc05a1259..9216f5c29 100644 --- a/Software/Visual_Studio/Tango.CodeGeneration/EntityCodeFile.cs +++ b/Software/Visual_Studio/Tango.CodeGeneration/EntityCodeFile.cs @@ -27,6 +27,11 @@ 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. /// @@ -64,6 +69,8 @@ namespace Tango.CodeGeneration /// public String Description { get; set; } + public String DbDescription { get; set; } + public bool IsForeignKey { get; set; } public String ForeignKeyName { get; set; } diff --git a/Software/Visual_Studio/Tango.CodeGeneration/ProtoProperty.cs b/Software/Visual_Studio/Tango.CodeGeneration/ProtoProperty.cs index d63348b6b..73debac37 100644 --- a/Software/Visual_Studio/Tango.CodeGeneration/ProtoProperty.cs +++ b/Software/Visual_Studio/Tango.CodeGeneration/ProtoProperty.cs @@ -22,5 +22,10 @@ namespace Tango.CodeGeneration Name = name; Type = type; } + + public ProtoProperty(String name, String type, String description) : this(name, type) + { + Description = description; + } } } diff --git a/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml b/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml index ee2d2ea12..873668545 100644 --- a/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml +++ b/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml @@ -20,6 +20,14 @@ using Tango.DAL.Remote.DB; namespace Tango.BL.Entities { + @if (Model.Description != null) + { +
+ /// + /// @(Model.Description) + /// +
+ } [Table("@(Model.TableName)")] public partial class @(Model.Name) : ObservableEntity<@(Model.Name)> { @@ -27,9 +35,22 @@ namespace Tango.BL.Entities {
protected @(prop.Type) _@(prop.Name.ToLower()); + @if (prop.DbDescription != null) + { +
+ /// + @(prop.DbDescription) + /// +
+ } + else + { +
/// /// Gets or sets the @(Model.Name.ToLower()) @(prop.Description). /// +
+ } @(!prop.Construct && !prop.Complex ? "[Column(\"" + prop.FieldName + "\")]" : "") @(prop.IsForeignKey ? "[ForeignKey(\"" + prop.ForeignKeyName + "\")]" : "") @(prop.XmlIgnore ? "[XmlIgnore]" : "") -- cgit v1.3.1