zengcheng / codesmith

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

Enum Namespace Problem #468

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Problem Description:

I have several Enum tables in my project.  During code generation, all Enums 
are placed in the same namespace as my Entities (which is fine).  However, my 
Managers use a different namespace.  As a result, each manager that references 
an Enum is broken upon generation because it is missing a reference to the 
namespace which contains my Enums.  I have to manually edit the *.generated.cs 
files to add the missing references.

-----------

What steps will reproduce the problem?

1. Setup a project with Dbml.cst, Entities.cst and Managers.cst.
2. Configure Dbml.cst with ContextNamespace="MyCompany.Core.Data" and 
EntityNamespace="MyCompany.Core.Data".
3. Configure Managers.cst with ManagerNamespace="MyCompany.Core.Managers".
4. Generate the outputs and try to compile the project.  The build will fail 
due to missing references.

-----------

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

The generated Manager files (Project\Managers\*.generated.cs) do not compile 
due to a missing reference to the namespace which contains the Enums.  Instead, 
the generated Manager files should have a reference at the top of the page.

Example 1:  using MyCompany.Core.Data;

Alternately, it could use a fully-qualified reference inline.

Example 2:  public IQueryable<MyCompany.Core.Data.NewsletterIssue> 
GetByStatusID(MyCompany.Core.Data.NewsletterStatus statusID)

Note that PLINQO currently uses a fully-qualified reference for the entity, but 
the Enum reference is missing the required prefix.

-----------

What version of the product are you using?

PLINQO 5.0.0.1687

-----------

Please provide any additional information below.

I have attached two files:
(1) A sample .csp file with my settings for further examination.
(2) A patch that adds the Entity namespace reference to the generated Manager 
code files.  The patch updates both the CSharp and VisualBasic templates.

Original issue reported on code.google.com by KevinLa...@gmail.com on 28 Jul 2010 at 5:08

Attachments:

GoogleCodeExporter commented 9 years ago
This issue was updated by revision r1892.

- fix enum issue with manager templates

Original comment by paul.wel...@gmail.com on 29 Jul 2010 at 9:01

GoogleCodeExporter commented 9 years ago
i fixed this is the latest version.

Original comment by paul.wel...@gmail.com on 29 Jul 2010 at 9:02