diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2019-09-23 14:50:38 +0300 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2019-09-23 14:50:38 +0300 |
| commit | b869bbeacf64595d2c716e1bf6257bb47ccf7221 (patch) | |
| tree | 75682cd663f0de6db45375dc122aa316f799cd5c /Software/Visual_Studio/Tango.CodeGeneration | |
| parent | bc9aa6ae0e64f4ddefcec06503b12e1daa4075d0 (diff) | |
| parent | 4cac9d0fb02430f725b37430d9eab78a8a39afee (diff) | |
| download | Tango-b869bbeacf64595d2c716e1bf6257bb47ccf7221.tar.gz Tango-b869bbeacf64595d2c716e1bf6257bb47ccf7221.zip | |
merge conflict
Diffstat (limited to 'Software/Visual_Studio/Tango.CodeGeneration')
4 files changed, 27 insertions, 1 deletions
diff --git a/Software/Visual_Studio/Tango.CodeGeneration/EntityCodeFile.cs b/Software/Visual_Studio/Tango.CodeGeneration/EntityCodeFile.cs index 958754a60..24d61bb0a 100644 --- a/Software/Visual_Studio/Tango.CodeGeneration/EntityCodeFile.cs +++ b/Software/Visual_Studio/Tango.CodeGeneration/EntityCodeFile.cs @@ -66,6 +66,8 @@ namespace Tango.CodeGeneration public String DbDescription { get; set; } + public RangeDescriptionModel RangeDescription { get; set; } + public bool IsForeignKey { get; set; } public String ForeignKeyName { get; set; } diff --git a/Software/Visual_Studio/Tango.CodeGeneration/RangeDescriptionModel.cs b/Software/Visual_Studio/Tango.CodeGeneration/RangeDescriptionModel.cs new file mode 100644 index 000000000..4600460b7 --- /dev/null +++ b/Software/Visual_Studio/Tango.CodeGeneration/RangeDescriptionModel.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.CodeGeneration +{ + public class RangeDescriptionModel + { + public String Description { get; set; } + public double Min { get; set; } + public double Max { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj b/Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj index a3b02afd5..6bff5b42e 100644 --- a/Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj +++ b/Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj @@ -77,6 +77,7 @@ <Compile Include="ProtoEnumFile.cs" /> <Compile Include="ProtoMessageFile.cs" /> <Compile Include="ProtoProperty.cs" /> + <Compile Include="RangeDescriptionModel.cs" /> <Compile Include="TangoDAOJavaFile.cs" /> <Compile Include="EnumerationFileJava.cs" /> <Compile Include="EnumerationFile.cs" /> @@ -128,7 +129,7 @@ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <ProjectExtensions> <VisualStudio> - <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" /> + <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" /> </VisualStudio> </ProjectExtensions> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 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) + { + <div> + [Description("@(prop.RangeDescription.Description)")] + [Range(@(prop.RangeDescription.Min),@(prop.RangeDescription.Max))] + </div> + } public @(prop.Construct || prop.Complex ? "virtual" : "") @(prop.Type) @(prop.Name) { get { return _@(prop.Name.ToLower()); } |
