Cyclic references through relationships

Posts   
 
    
jthieret
User
Posts: 3
Joined: 24-Feb-2012
# Posted on: 15-Mar-2012 19:21:45   

We are getting a warning about cyclic references in our entity model. And, yes, our model does have cyclic references. The warning message says "These cycles aren't recommended and should be removed."

I would like to know what the consequences would be if we ignored the warning. All I am able to find on this is that these cyclic references may cause issues with Xml serialization, but we aren't serializing any of our entities.

If these are going to cause us problems, are there any work-arounds other than redesigning our model?

Thanks!

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 15-Mar-2012 21:05:56   

You have to analyze your relationship, it may be like it's a necessary relationship like in Employee.WorksForDepartmentId, and Department.ManagedByEmployeeId. In this case one of those FK must be nullable in order to save successfully one employee or one department. Here is more on that: http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=18661&StartAtMessage=0&#104847

That's is why it's a warning and not an error. I don't think this will be a problem in code, other than the fact that it's cyclic stuck_out_tongue_winking_eye and you need to take that into account when you fetch/save. You also need to name the navigators with distinctive names in order to identify correctly each relation/navigator at code.

David Elizondo | LLBLGen Support Team