diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-07-10 15:24:06 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-07-10 15:24:06 +0300 |
| commit | 5d795170b304199383ac967583830acaf313ff05 (patch) | |
| tree | f8888b3ae72410a02a4b7361c235540138950ac8 /Software/Visual_Studio/Tango.CodeGeneration | |
| parent | 9244c34a40d572f071cdf1c00ad6428132e1ab5c (diff) | |
| download | Tango-5d795170b304199383ac967583830acaf313ff05.tar.gz Tango-5d795170b304199383ac967583830acaf313ff05.zip | |
Some work on PPC.
Implemented retrieval of column description for auto generated observables & pmr's.
Diffstat (limited to 'Software/Visual_Studio/Tango.CodeGeneration')
3 files changed, 33 insertions, 0 deletions
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 @@ -28,6 +28,11 @@ namespace Tango.CodeGeneration public List<EntityCodeFileField> Fields { get; set; } /// <summary> + /// Gets or sets the description. + /// </summary> + public String Description { get; set; } + + /// <summary> /// Initializes a new instance of the <see cref="EntityCodeFile"/> class. /// </summary> /// <param name="name">The code file name.</param> @@ -64,6 +69,8 @@ namespace Tango.CodeGeneration /// </summary> 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) + { + <div> + /// <summary> + /// @(Model.Description) + /// </summary> + </div> + } [Table("@(Model.TableName)")] public partial class @(Model.Name) : ObservableEntity<@(Model.Name)> { @@ -27,9 +35,22 @@ namespace Tango.BL.Entities { <div> protected @(prop.Type) _@(prop.Name.ToLower()); + @if (prop.DbDescription != null) + { + <div> + /// <summary> + @(prop.DbDescription) + /// </summary> + </div> + } + else + { + <div> /// <summary> /// Gets or sets the @(Model.Name.ToLower()) @(prop.Description). /// </summary> + </div> + } @(!prop.Construct && !prop.Complex ? "[Column(\"" + prop.FieldName + "\")]" : "") @(prop.IsForeignKey ? "[ForeignKey(\"" + prop.ForeignKeyName + "\")]" : "") @(prop.XmlIgnore ? "[XmlIgnore]" : "") |
