This question is locked. New answers and comments are not allowed.
Hello,
We are porting a MsSQL database which makes extensive use of schemas. When the database is transferred from MsSQL to MySQL using the MySQL migration wizard, the naming of the tables change from something like this: lku.MessagePriority to: lku_message_priority.
We would like to update the code generation to treat the lku_ (first instance of the underscore) as part of the namespace for the generated class.
We have tried adding some additional code to the ClassGenerator.ttinclude in the GenerateClassSignature method
replaced line 67:
implements.AddFirst(codeClass.BaseClass.Name);
with:
var namespace = codeClass.BaseClass.Name.Substring(0, 3);
var className = codeClass.BaseClass.Name.Replace(namespace, "");
implements.AddFirst(string.Format("{0}.{1}", namespace, className));
This works for the classes, but the references to the classes are not correct.
Which of the ttinclude files can we modify to change the namespaces and class names when the tables definitions are read from the database?
Thank you,
Michael
We are porting a MsSQL database which makes extensive use of schemas. When the database is transferred from MsSQL to MySQL using the MySQL migration wizard, the naming of the tables change from something like this: lku.MessagePriority to: lku_message_priority.
We would like to update the code generation to treat the lku_ (first instance of the underscore) as part of the namespace for the generated class.
We have tried adding some additional code to the ClassGenerator.ttinclude in the GenerateClassSignature method
replaced line 67:
implements.AddFirst(codeClass.BaseClass.Name);
with:
var namespace = codeClass.BaseClass.Name.Substring(0, 3);
var className = codeClass.BaseClass.Name.Replace(namespace, "");
implements.AddFirst(string.Format("{0}.{1}", namespace, className));
This works for the classes, but the references to the classes are not correct.
Which of the ttinclude files can we modify to change the namespaces and class names when the tables definitions are read from the database?
Thank you,
Michael