Print Page | Close Window

How to Include Related Items when there are in the same table

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=3721
Printed Date: 12-Jan-2026 at 12:44pm


Topic: How to Include Related Items when there are in the same table
Posted By: gregweb
Subject: How to Include Related Items when there are in the same table
Date Posted: 16-Oct-2012 at 7:20pm
I have a table like this:

ContactId
First
Last
ParentContactId

If ParentContactId is populated, it means it is a ChildContact.

This is the query I want to do:

EntityManager.Contacts.Include(a=> a.ChildContacts)

How would I do this in DevForce?

Greg



Replies:
Posted By: gregweb
Date Posted: 16-Oct-2012 at 7:59pm
I found a sample in NorthwindIB in the Employee table that shows a self referenceing table - basically all I had to do was add the relation and it worked as expected.



Print Page | Close Window