From bf432bf7b7faa7c51e74462e19eb3e50c28b4aa8 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Wed, 22 Jan 2020 18:00:55 +0200 Subject: Implemented StringFormat control for db properties. Added StringFormat 0.000 for FeederTension on ProcessParameters. --- .../Templates/EntityCodeFile.cshtml | 25 +++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml') 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) { -
- [Description("@(prop.RangeDescription.Description)")] - [Range(@(prop.RangeDescription.Min),@(prop.RangeDescription.Max))] -
+ if (prop.PropertyExtension.HasDescription) + { +
+ [Description("@(prop.PropertyExtension.Description)")] +
+ } + if (prop.PropertyExtension.HasRange) + { +
+ [Range(@(prop.PropertyExtension.Min),@(prop.PropertyExtension.Max))] +
+ } + if (prop.PropertyExtension.HasStringFormat) + { +
+ [StringFormat("@(prop.PropertyExtension.StringFormat)")] +
+ } } public @(prop.Construct || prop.Complex ? "virtual" : "") @(prop.Type) @(prop.Name) { -- cgit v1.3.1