Jeff-Lewis / codesmith

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

PLINQO - Missing Entities namespace inEntityManager.Generated and QueryEntensions.Generated templates. #163

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I noticed that if you choose to generate enum's from enum tables with your 
DBML, the manager and query classes break because they are missing the 
using directives to the entity namespace. This only seems to happen if you 
build enum tables with the DBML.   

What steps will reproduce the problem?
1. Run the quickstart, make sure you specify your Entity Namespace as 
something other than blank, such as 'Entities',  then generate and compile 
the solution successfully.
2. Now define an enum table in your DBML template and regenerate. The 
solution will now throw compile errors. If you look closer you will see 
those errors are because the generated manager and queryextension classes 
are missing using directives to your entity namespace. If you manually add 
them in (not recommended in generated classes) it proves the point as the 
solution will then compile. We can fix this easily in the template source.  

What is the expected output? What do you see instead?
The code should generate and compile.

What version of the product are you using?
All - 3.1 and up to latest nightly build.

Please provide any additional information below.
I have fixed this easily by editing the 2 template source files;
EntityManager.Generated.cst
QueryExtension.Generated.cst

and added the following line to each one near the top;
using <%= Database.EntityNamespace %>;

I have attached these 2 files for your reference. Would be nice if you 
could amend this in the source repo. I cannot see any negative side-effects 
from this so far.

Thanks!

Original issue reported on code.google.com by noo...@gmail.com on 15 Oct 2009 at 2:12

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by shannon....@gmail.com on 15 Oct 2009 at 3:35

GoogleCodeExporter commented 9 years ago

Original comment by shannon....@gmail.com on 15 Oct 2009 at 3:37

GoogleCodeExporter commented 9 years ago
Hi, This patch is not needed.  All the entities are generated with the full
namespace.  You might be using an older version where this wasn't true.  Try the
latest build and see if you still have issues.

Original comment by paul.wel...@gmail.com on 29 Oct 2009 at 3:02