New Posts New Posts RSS Feed: How to Include Related Items when there are in the same table
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

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

 Post Reply Post Reply
Author
gregweb View Drop Down
DevForce MVP
DevForce MVP
Avatar

Joined: 10-Sep-2009
Location: Clearwater, Fl
Posts: 253
Post Options Post Options   Quote gregweb Quote  Post ReplyReply Direct Link To This Post Topic: How to Include Related Items when there are in the same table
    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

Edited by gregweb - 16-Oct-2012 at 7:23pm
Back to Top
gregweb View Drop Down
DevForce MVP
DevForce MVP
Avatar

Joined: 10-Sep-2009
Location: Clearwater, Fl
Posts: 253
Post Options Post Options   Quote gregweb Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down