From d33c19b3ac6803de4b5c8d475832efef131c1a45 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Wed, 30 Dec 2020 15:11:34 +0000 Subject: Revert "Hope it is fine" --- .../Templates/EntityCodeFile.cshtml | 31 ++++++++++++++++++---- 1 file changed, 26 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..76c035df9 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,32 @@ 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)")] +
+ } + if (prop.PropertyExtension.HasIndex) + { +
+ [PropertyIndex(@(prop.PropertyExtension.Index))] +
+ } } public @(prop.Construct || prop.Complex ? "virtual" : "") @(prop.Type) @(prop.Name) { -- cgit v1.3.1