aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-10-10 19:03:09 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-10-10 19:03:09 +0300
commita5c351107e53c26d12c880dfc926eefbe8ddee57 (patch)
tree1fdf42512f1b52e78bc8a4e8030511eba8a410b7 /Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI
parent112fc0501b635b769f875f32f34c22041f25836e (diff)
downloadTango-a5c351107e53c26d12c880dfc926eefbe8ddee57.tar.gz
Tango-a5c351107e53c26d12c880dfc926eefbe8ddee57.zip
Added valves to db ,observables and PMR.
Diffstat (limited to 'Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI')
-rw-r--r--Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/ObservablesGenerator.cs14
1 files changed, 10 insertions, 4 deletions
diff --git a/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/ObservablesGenerator.cs b/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/ObservablesGenerator.cs
index fc2245e80..876639b78 100644
--- a/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/ObservablesGenerator.cs
+++ b/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/ObservablesGenerator.cs
@@ -54,7 +54,7 @@ namespace Tango.DBObservablesGenerator.CLI
table_description = db_des.TableDescription;
}
- EntityCodeFile codeFile = new EntityCodeFile(DalNameToStandardName(table.Name).SingularizeMVC())
+ EntityCodeFile codeFile = new EntityCodeFile(table.Name == "TECH_VALVES" ? "TechValve" : DalNameToStandardName(table.Name).SingularizeMVC())
{
EntityName = table.Name.SingularizeMVC(),
TableName = table.Name,
@@ -190,10 +190,12 @@ namespace Tango.DBObservablesGenerator.CLI
foreach (var table in typeof(RemoteDB).GetProperties().Where(x => typeof(IEnumerable).IsAssignableFrom(x.PropertyType)))
{
+ String tName = table.PropertyType.GenericTypeArguments.Single().Name;
+
adapterFile.Properties.Add(new Property()
{
Name = DalNameToStandardName(table.Name),
- Type = String.Format("ObservableCollection<{0}>", DalNameToStandardName(table.PropertyType.GenericTypeArguments.Single().Name).SingularizeMVC()),
+ Type = String.Format("ObservableCollection<{0}>", tName == "TECH_VALVES" ? "TechValve" : DalNameToStandardName(tName).SingularizeMVC()),
});
}
@@ -211,10 +213,12 @@ namespace Tango.DBObservablesGenerator.CLI
foreach (var table in typeof(RemoteDB).GetProperties().Where(x => typeof(IEnumerable).IsAssignableFrom(x.PropertyType)))
{
+ String tName = table.PropertyType.GenericTypeArguments.Single().Name;
+
collectionsFile.Properties.Add(new Property()
{
Name = DalNameToStandardName(table.Name),
- Type = String.Format("ObservableCollection<{0}>", DalNameToStandardName(table.PropertyType.GenericTypeArguments.Single().Name).SingularizeMVC()),
+ Type = String.Format("ObservableCollection<{0}>", tName == "TECH_VALVES" ? "TechValve" : DalNameToStandardName(tName).SingularizeMVC()),
});
}
@@ -232,10 +236,12 @@ namespace Tango.DBObservablesGenerator.CLI
foreach (var table in typeof(RemoteDB).GetProperties().Where(x => typeof(IEnumerable).IsAssignableFrom(x.PropertyType)))
{
+ String tName = table.PropertyType.GenericTypeArguments.Single().Name;
+
contextFile.Properties.Add(new Property()
{
Name = DalNameToStandardName(table.Name),
- Type = String.Format("DbSet<{0}>", DalNameToStandardName(table.PropertyType.GenericTypeArguments.Single().Name).SingularizeMVC()),
+ Type = String.Format("DbSet<{0}>", tName == "TECH_VALVES" ? "TechValve" : DalNameToStandardName(tName).SingularizeMVC()),
});
}
String contextCode = contextFile.GenerateCode();