Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > Bugs & Issues> EF 6 - edmx error due to many to many relationship
 

Pages: 1
Bugs & Issues
EF 6 - edmx error due to many to many relationship
Page:1/1 

  Print all messages in this thread  
Poster Message
Shafeeq
User



Location:

Joined on:
26-Jan-2019 11:28:57
Posted:
2 posts
# Posted on: 26-Jan-2019 11:46:47.  
Hello, were testing generating edmx file (using dbcontext api preset), and are having issue with scenario where an entity has many to many relationship with itself (through intermediary table), the generated edmx when used in projects shows the following error

error 0074: NavigationProperty is not valid. The FromRole and ToRole are the same.

Below the line in the edmx which is causing the probelm
<NavigationProperty Name="RoleCollectionViaRolesRole" Relationship="Self.Role_RoleCollectionViaRolesRole_Role_RoleCollectionViaRolesRole_" FromRole="Role" ToRole="Role" />

To further elaborate, below the an example of tables and relations involved (e.g. idea is that each role can have multiple sub roles):
Main Table: Roles
Relationship table (RolesRole) - only has two columns ParentRoleId and ChildRoleId
Relationships:
Roles 1:m RoleRoles (Parent Rlateionship)
Roles 1:m RoleRoles (For Child Relationship)


  Top
Otis
LLBLGen Pro Team



Location:
The Hague, The Netherlands
Joined on:
17-Aug-2003 18:00:36
Posted:
37317 posts
# Posted on: 27-Jan-2019 09:15:24.  
What's the designer version you're using? If it's not 5.5.1, have you tried the latest build? If possible could you attach the project? If not, please open a helpdesk thread and attach it there so we can have a look.

Frans Bouma
LLBLGen Pro / ORM Profiler Lead Developer | Blog | Twitter
 
Top
Shafeeq
User



Location:

Joined on:
26-Jan-2019 11:28:57
Posted:
2 posts
# Posted on: 27-Jan-2019 11:10:25. Goto attachments  
its latest version is 5.5.1 (trial version), attached sample project.
  Top
daelmo
Support Team



Location:
Guatemala City
Joined on:
28-Nov-2005 23:35:24
Posted:
8041 posts
# Posted on: 28-Jan-2019 07:26:07.  
Reproduced it. We will look into it.

David Elizondo
LLBLGen'ing (articles and code snippets) | linkedin | twitter
 
Top
Otis
LLBLGen Pro Team



Location:
The Hague, The Netherlands
Joined on:
17-Aug-2003 18:00:36
Posted:
37317 posts
# Posted on: 28-Jan-2019 12:05:59. Goto attachments  
As you're a trial user and can't download hotfixes, could you try the attached template?

Copy it into the folder (as administrator, overwriting the existing one)
<llblgen installation folder>\Frameworks\Entity Framework\Templates\Shared\Shared

then regenerate the code, it should solve the issue.

As you're still in the startup of you project, it might be a good idea to choose as output to generate code first code instead of dbcontext + edmx (unless you need the features not supported through EF6 code first), as edmx has some limitations in inheritance hierarchies (if you use these).
Frans Bouma
LLBLGen Pro / ORM Profiler Lead Developer | Blog | Twitter
 
Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.