aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2020-01-22 18:00:55 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2020-01-22 18:00:55 +0200
commitbf432bf7b7faa7c51e74462e19eb3e50c28b4aa8 (patch)
tree2cce2090c2455f2cadc3f8288f05688ae60a9ed5 /Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI
parent287af6d4bed5333087cb9d702d20035b1ad9a326 (diff)
downloadTango-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/Utilities/Tango.DBObservablesGenerator.CLI')
-rw-r--r--Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/ObservablesGenerator.cs21
1 files changed, 14 insertions, 7 deletions
diff --git a/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/ObservablesGenerator.cs b/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/ObservablesGenerator.cs
index 92eab0857..ac20feb04 100644
--- a/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/ObservablesGenerator.cs
+++ b/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/ObservablesGenerator.cs
@@ -53,7 +53,7 @@ namespace Tango.DBObservablesGenerator.CLI
String table_description = null;
var db_des = dbDescriptions.FirstOrDefault(x => x.TableName == table.Name);
- if (db_des != null)
+ if (db_des != null && !String.IsNullOrWhiteSpace(db_des.TableDescription))
{
table_description = db_des.TableDescription;
}
@@ -121,24 +121,31 @@ namespace Tango.DBObservablesGenerator.CLI
if (column_description != null)
{
- RangeDescriptionModel rangeDescription = null;
+ DbPropertyExtensionModel dbPropertyExtensionModel = null;
try
{
- rangeDescription = JsonConvert.DeserializeObject<RangeDescriptionModel>(column_description);
+ dbPropertyExtensionModel = JsonConvert.DeserializeObject<DbPropertyExtensionModel>(column_description, new JsonSerializerSettings()
+ {
+ NullValueHandling = NullValueHandling.Ignore,
+ MissingMemberHandling = MissingMemberHandling.Ignore,
+ });
}
catch { }
- if (rangeDescription != null && rangeDescription.Description != null)
+ if (dbPropertyExtensionModel != null)
{
- codeField.RangeDescription = rangeDescription;
- codeField.DbDescription = rangeDescription.Description.ToLines().Select(x => "/// " + x).Join(Environment.NewLine);
+ codeField.PropertyExtension = dbPropertyExtensionModel;
+
+ if (dbPropertyExtensionModel.Description != null)
+ {
+ codeField.DbDescription = dbPropertyExtensionModel.Description.ToLines().Select(x => "/// " + x).Join(Environment.NewLine);
+ }
}
else
{
codeField.DbDescription = column_description.ToLines().Select(x => "/// " + x).Join(Environment.NewLine);
}
-
}
if (field.PropertyType.IsGenericType)