zengcheng / codesmith

Automatically exported from code.google.com/p/codesmith
0 stars 0 forks source link

PLINQO: Certain column names cause issues when generating Entities #24

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Add three columns to a table (_Descriptor, _CreateDate, _EditDate)
2. Generate Dbml
3. Generate Entities.cst against the generated Dbml

What is the expected output? What do you see instead?

I receive the following error:
System.Collections.Generic.KeyNotFoundException: The given key was not 
present in the dictionary.
   at System.ThrowHelper.ThrowKeyNotFoundException()
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at 
_CodeSmith.Entities_cst.EntityEditableClass.__RenderMethod1(TextWriter 
writer, Control control) in 
e:\Projects\ClickMotiveSVN\ClickMotive.Data\trunk\Templates\CSharp\Internal
\Entity.Editable.cst:line 67
   at CodeSmith.Engine.DelegateControl.Render(TextWriter writer)
   at CodeSmith.Engine.Control.RenderChildren(TextWriter writer)
   at CodeSmith.Engine.Control.Render(TextWriter writer)
   at CodeSmith.Engine.CodeTemplate.Render(TextWriter writer)
   at CodeSmith.Engine.CodeTemplate.RenderToString()
   at CodeSmith.Engine.CodeTemplate.RenderToFile(OutputFile outputFile, 
String sourcePath, IMergeStrategy strategy)
   at CodeSmith.Engine.CodeTemplate.RenderToFile(String path, String 
sourcePath, IMergeStrategy strategy)
   at CodeSmith.Engine.CodeTemplate.RenderToFile(String path, 
IMergeStrategy strategy)
   at _CodeSmith.Entities_cst.CreateEntity(EntityGeneratedClass 
entityClass, EntityEditableClass partialClass, Type type) in 
e:\Projects\ClickMotiveSVN\ClickMotive.Data\trunk\Templates\CSharp\Entities
.cst:line 223
   at _CodeSmith.Entities_cst.CreateEntityClasses(Database database) in 
e:\Projects\ClickMotiveSVN\ClickMotive.Data\trunk\Templates\CSharp\Entities
.cst:line 177
   at _CodeSmith.Entities_cst.Generate() in 
e:\Projects\ClickMotiveSVN\ClickMotive.Data\trunk\Templates\CSharp\Entities
.cst:line 83
   at _CodeSmith.Entities_cst.__RenderMethod1(TextWriter writer, Control 
control) in 
e:\Projects\ClickMotiveSVN\ClickMotive.Data\trunk\Templates\CSharp\Entities
.cst:line 242
   at CodeSmith.Engine.DelegateControl.Render(TextWriter writer)
   at CodeSmith.Engine.Control.RenderChildren(TextWriter writer)
   at CodeSmith.Engine.Control.Render(TextWriter writer)
   at CodeSmith.Engine.CodeTemplate.Render(TextWriter writer)
   at CodeSmith.Engine.CodeTemplate.RenderToString()
   at ej.s()

The problem exists in the Entity.Editable.cst template.  I have created an 
svn patch that solves the problem.

What version of the product are you using?
PLINQO, latest from SVN

Original issue reported on code.google.com by likwid on 22 Oct 2008 at 5:01

Attachments:

GoogleCodeExporter commented 9 years ago
patch applied.  Thank you!

Original comment by paul.wel...@gmail.com on 22 Oct 2008 at 4:14