diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2020-01-22 18:00:55 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2020-01-22 18:00:55 +0200 |
| commit | bf432bf7b7faa7c51e74462e19eb3e50c28b4aa8 (patch) | |
| tree | 2cce2090c2455f2cadc3f8288f05688ae60a9ed5 /Software/Visual_Studio/Tango.CodeGeneration/Templates | |
| parent | 287af6d4bed5333087cb9d702d20035b1ad9a326 (diff) | |
| download | Tango-bf432bf7b7faa7c51e74462e19eb3e50c28b4aa8.tar.gz Tango-bf432bf7b7faa7c51e74462e19eb3e50c28b4aa8.zip | |
Implemented StringFormat control for db properties.
Added StringFormat 0.000 for FeederTension on ProcessParameters.
Diffstat (limited to 'Software/Visual_Studio/Tango.CodeGeneration/Templates')
| -rw-r--r-- | Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml b/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml index 950e24f79..780cc2647 100644 --- a/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml +++ b/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml @@ -19,6 +19,7 @@ using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; using System.ComponentModel; +using Tango.Core.CustomAttributes; namespace Tango.BL.Entities { @@ -67,12 +68,26 @@ namespace Tango.BL.Entities @(prop.IsForeignKey ? "[ForeignKey(\"" + prop.ForeignKeyName + "\")]" : "") @(prop.XmlIgnore ? "[XmlIgnore]" : "") @(prop.XmlIgnore ? "[JsonIgnore]" : "") - @if (prop.RangeDescription != null) + @if (prop.PropertyExtension != null) { - <div> - [Description("@(prop.RangeDescription.Description)")] - [Range(@(prop.RangeDescription.Min),@(prop.RangeDescription.Max))] - </div> + if (prop.PropertyExtension.HasDescription) + { + <div> + [Description("@(prop.PropertyExtension.Description)")] + </div> + } + if (prop.PropertyExtension.HasRange) + { + <div> + [Range(@(prop.PropertyExtension.Min),@(prop.PropertyExtension.Max))] + </div> + } + if (prop.PropertyExtension.HasStringFormat) + { + <div> + [StringFormat("@(prop.PropertyExtension.StringFormat)")] + </div> + } } public @(prop.Construct || prop.Complex ? "virtual" : "") @(prop.Type) @(prop.Name) { |
