Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7494279
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T17:25:49+00:00 2026-05-29T17:25:49+00:00

I have a table that has an Self referencing relationship – One Wall comment

  • 0

I have a table that has an “Self referencing relationship” – One Wall comment maybe a child of other. This is my Data Model:

public class UserWall
{
    [Key]
    public int WId { get; set; }

    public Guid UserId { get; set; }

    public string WContent { get; set; }

    public Guid? WriterId { get; set; }

    [DataType(DataType.DateTime)]
    public DateTime WTime { get; set; }

    public int? ParentWId { get; set; }

    public virtual UserWall Parent { get; set; }

    public virtual ICollection<UserWall> Children { get; set; }
}

And so, with this URI /MyService.svc/UserWalls(1)/ I got:

<?xml version="1.0" encoding="utf-8"?>
<entry xml:base="http://localhost:1636/CoreService.svc/" xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml">
  <id>http://localhost:1636/CoreService.svc/UserWalls(1)</id>
  <category term="ESN.Models.UserWall" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
  <link rel="edit" title="UserWall" href="UserWalls(1)" />
  <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Parent" type="application/atom+xml;type=entry" title="Parent" href="UserWalls(1)/Parent" />
  <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Children" type="application/atom+xml;type=feed" title="Children" href="UserWalls(1)/Children" />
  <title />
  <updated>2012-02-15T04:07:39Z</updated>
  <author>
    <name />
  </author>
  <content type="application/xml">
    <m:properties>
      <d:WId m:type="Edm.Int32">1</d:WId>
      <d:UserId m:type="Edm.Guid">e735311a-55fd-48cb-bac0-3441ae99ebea</d:UserId>
      <d:WContent>cức</d:WContent>
      <d:WriterId m:type="Edm.Guid">e735311a-55fd-48cb-bac0-3441ae99ebea</d:WriterId>
      <d:WTime m:type="Edm.DateTime">2012-02-15T01:01:00</d:WTime>
      <d:ParentWId m:type="Edm.Int32" m:null="true" />
    </m:properties>
  </content>
</entry>

And with the URI /MyService.svc/UserWalls(1)/Children I can get their children.

But is there anyway that I can load the children data without the extra request?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T17:26:14+00:00Added an answer on May 29, 2026 at 5:26 pm

    Yes, you should be able to use the $expand keyword.
    Ex: /MyService.svc/UserWalls(1)?$expand=Children

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a self referencing table called project that has a master detail relationship
I have a self referencing table named categories that has a parentcategoryid column that
I have a table called Metrics that is a self-referencing table. Meaning it has
I have one table that has sales records and another table that has additional
I have a table which has a foreign key referencing itself. This would be
I have a table that has its content filled using one of the two
i have a very simple table with only one row that has a uiswitch
I have a table of records, which has a self-relationship. Additionally - to make
I have a table that has redundant data and I'm trying to identify all
I have a table that has an insert trigger on it. If I insert

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.