Code Generation does generate wrong method names
Posted: Mon 09 Nov 2009 13:09
Hi,
We created tables using the "create from database" wizard and I choosed "Unchanged" for alle the capitalize/singularize/pluralize options and the generated Classes, Properties and Entity Set names look ok.
For example there's a Class named "SyncRev" and the Entity Set is also "SyneRev".
But when I generate the code I get a "SyncRevs" Method for this table name instead of "SyncRev" (the Entity Set name). For us it is very disturbing that the code generator does pluralize the generated method names. When the setting in the project is "unchanged" the code generator should also stick to this setting and just use the "Entity Set" name given because most of our tables have generated names and it breaks the mapping between our table names and the generated method names if some of the them get pluralized. For example "Cstmrs" is not pluralized but "CwCTTentX" gets a method name "CwCTTEntXes".
We must get rid of the additional "s" or "es", how can we do this and why does the code generator ignore the "Entity Set" Name when generating classes?
Thanks for any help.
We created tables using the "create from database" wizard and I choosed "Unchanged" for alle the capitalize/singularize/pluralize options and the generated Classes, Properties and Entity Set names look ok.
For example there's a Class named "SyncRev" and the Entity Set is also "SyneRev".
But when I generate the code I get a "SyncRevs" Method for this table name instead of "SyncRev" (the Entity Set name). For us it is very disturbing that the code generator does pluralize the generated method names. When the setting in the project is "unchanged" the code generator should also stick to this setting and just use the "Entity Set" name given because most of our tables have generated names and it breaks the mapping between our table names and the generated method names if some of the them get pluralized. For example "Cstmrs" is not pluralized but "CwCTTentX" gets a method name "CwCTTEntXes".
We must get rid of the additional "s" or "es", how can we do this and why does the code generator ignore the "Entity Set" Name when generating classes?
Thanks for any help.