aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2019-01-03 13:36:10 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2019-01-03 13:36:10 +0200
commit185865c043b5fdaffef5356e305e0cc553ccc126 (patch)
tree307084e5e9eb63e68356a1b5908edde068ca7a21 /Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI
parent25f5e6ddef7ef2fa0a747305847eeb4ceee5a2c9 (diff)
downloadTango-185865c043b5fdaffef5356e305e0cc553ccc126.tar.gz
Tango-185865c043b5fdaffef5356e305e0cc553ccc126.zip
Added new BL entities with inheritance !!!!
Diffstat (limited to 'Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI')
-rw-r--r--Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/ObservablesGenerator.cs11
1 files changed, 9 insertions, 2 deletions
diff --git a/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/ObservablesGenerator.cs b/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/ObservablesGenerator.cs
index 3a40dfd1f..2c58be781 100644
--- a/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/ObservablesGenerator.cs
+++ b/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/ObservablesGenerator.cs
@@ -57,7 +57,7 @@ namespace Tango.DBObservablesGenerator.CLI
table_description = db_des.TableDescription;
}
- EntityCodeFile codeFile = new EntityCodeFile(table.Name == "TECH_VALVES" ? "TechValve" : DalNameToStandardName(table.Name).SingularizeMVC())
+ EntityCodeFile codeFile = new EntityCodeFile((table.Name == "TECH_VALVES" ? "TechValve" : DalNameToStandardName(table.Name).SingularizeMVC()) + "Base")
{
EntityName = table.Name.SingularizeMVC(),
TableName = table.Name,
@@ -74,7 +74,7 @@ namespace Tango.DBObservablesGenerator.CLI
{
Console.ForegroundColor = ConsoleColor.Yellow;
- Console.WriteLine($"Specious entry at {table.Name}.");
+ Console.WriteLine($"Suspicious entry at {table.Name}.");
for (int i = 0; i < Math.Max(guessed_keys.Count, foreignKeys.Count); i++)
{
if (i < guessed_keys.Count)
@@ -166,6 +166,13 @@ namespace Tango.DBObservablesGenerator.CLI
String entitiesPath = Path.Combine(targetPath, "Entities");
Directory.CreateDirectory(entitiesPath);
File.WriteAllText(Path.Combine(entitiesPath, codeFile.Name + ".cs"), code);
+
+ if (!File.Exists(Path.Combine(entitiesPath, codeFile.Name + ".cs")))
+ {
+ EntityInheritedCodeFile inherited = new EntityInheritedCodeFile(codeFile.Name.Replace("Base", ""), codeFile.Name);
+ String inheritedCode = inherited.GenerateCode();
+ File.WriteAllText(Path.Combine(entitiesPath, inherited.Name + ".cs"), inheritedCode);
+ }
}
//Generate Entities...