TypedView and Entity Relations

Posts   
 
    
Posts: 2
Joined: 26-Apr-2005
# Posted on: 26-Apr-2005 01:18:22   

I'm a little confused on how to appropriately use the new "Add new Entities Mapped on Views..." functionality. Ultimately, I want to join one of my views with an Entity so I can filter off one of the Entity's fields.

When I add the View as an entity in the designer, then generate the code, I end up with a compile error, "The namespace "..." already contains a definition for 'LoanGridViewFieldIndex'". It looks like the Entity and the TypedView's field indexes are being named the same. Am I doing this right? Are there any examples in the documentation that show how to do this?

Thanks,

Tony Roberts

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 26-Apr-2005 10:03:20   

tonyeroberts wrote:

I'm a little confused on how to appropriately use the new "Add new Entities Mapped on Views..." functionality. Ultimately, I want to join one of my views with an Entity so I can filter off one of the Entity's fields.

When I add the View as an entity in the designer, then generate the code, I end up with a compile error, "The namespace "..." already contains a definition for 'LoanGridViewFieldIndex'". It looks like the Entity and the TypedView's field indexes are being named the same. Am I doing this right? Are there any examples in the documentation that show how to do this?

The issue you run into is caused indeed by the fact that you have a typed view and an entity with the same name. It's wise to rename the view or the entity so they're named differently. Helps you recognize which field indexes you need.

I'll file this as a bug though so a better check will be added for this in the designer.

Frans Bouma | Lead developer LLBLGen Pro
Posts: 2
Joined: 26-Apr-2005
# Posted on: 26-Apr-2005 19:05:50   

That's what I thought as well, but when I change the name of the Entity, it doesn't change the name of that enum and I end up with the same problem. I'll try changing the name of the View to see if that solves the problem.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 26-Apr-2005 22:15:58   

tonyeroberts wrote:

That's what I thought as well, but when I change the name of the Entity, it doesn't change the name of that enum and I end up with the same problem. I'll try changing the name of the View to see if that solves the problem.

Huh? It should change the name of the enum! simple_smile . Are you sure the file was re-generated? (and not skipped as in 'read only')

Frans Bouma | Lead developer LLBLGen Pro