From 48c5d636927f832497e8939a8423ecd1c16892d7 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Thu, 19 Sep 2019 14:05:34 +0300 Subject: Implemented hardware parameter description and range through DB and observables generator. --- .../Tango.CodeGeneration/Templates/EntityCodeFile.cshtml | 8 ++++++++ 1 file changed, 8 insertions(+) (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 b5d47edab..950e24f79 100644 --- a/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml +++ b/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml @@ -18,6 +18,7 @@ using Newtonsoft.Json; using System.Linq; using Tango.DAL.Remote.DB; using Tango.Core; +using System.ComponentModel; namespace Tango.BL.Entities { @@ -66,6 +67,13 @@ namespace Tango.BL.Entities @(prop.IsForeignKey ? "[ForeignKey(\"" + prop.ForeignKeyName + "\")]" : "") @(prop.XmlIgnore ? "[XmlIgnore]" : "") @(prop.XmlIgnore ? "[JsonIgnore]" : "") + @if (prop.RangeDescription != null) + { +
+ [Description("@(prop.RangeDescription.Description)")] + [Range(@(prop.RangeDescription.Min),@(prop.RangeDescription.Max))] +
+ } public @(prop.Construct || prop.Complex ? "virtual" : "") @(prop.Type) @(prop.Name) { get { return _@(prop.Name.ToLower()); } -- cgit v1.3.1