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 8301151
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T16:50:13+00:00 2026-06-08T16:50:13+00:00

I have an ASP.NET MVC 4 Web API app using EntityFramework for ORM. In

  • 0

I have an ASP.NET MVC 4 Web API app using EntityFramework for ORM.

In the JSON I return, there are some cases where the same child node is present for multiple parent nodes. In these cases, the first occurrence of the child node is fully visible with all it’s members. Any subsequent occurrence shows up as a $ref to the first occurrence.
I’d like instead to see the full object everytime it shows up in the JSON returned.

For example, instead of seeing:

    [{
    "$id": "1",
    "userId": 1,
    "Badge": {
        "$id": "2",
        "badgeId": 1,
        "badgeName": "Gold"
        }
    }, {
    "$id": "3",
    "userId": 2,
    "Badge": {
        "$ref": "2"
        }
    }]

i’d like to see:

    [{
    "$id": "1",
    "userId": 1,
    "Badge": {
        "$id": "2",
        "badgeId": 1,
        "badgeName": "Gold"
        }
    }, {
    "$id": "3",
    "userId": 2,
    "Badge": {
        "$id": "4",
        "badgeId": 1,
        "badgeName": "Gold"
        }
    }]

Basically I want to get rid of any “$ref” in the JSON. Is there a way?

Thanks!

  • 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-06-08T16:50:18+00:00Added an answer on June 8, 2026 at 4:50 pm

    An easy way is to edit the generated entity classes code. For each of the entity classes, there will be a [DataContract(IsReference=true)] attribute assigned.

    Something like the following:

    [EdmEntityTypeAttribute(NamespaceName="YourNamespace", Name="YourEntity")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class YourEntity : EntityObject
    {
    

    Change it to IsReference=false. That should do the trick.

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

Sidebar

Related Questions

I am developing some sort of service using asp.net mvc 4 web api. On
Im trying to develop my first ASP.NET MVC web app and have run into
I have an object which contains models for my ASP.NET MVC web app. The
I'm implementing a web API using the REST for ASP.NET MVC framework (MVC 2).
I have an ASP.Net MVC web app that includes a set of Forums. In
I have a asp.net mvc web application an it uses some favicon.ico. Now when
I have an ASP.NET MVC web app whose controllers use WCF to call into
I'm building a RESTful web api with asp.net mvc, which returns pure json data.
I am using ASP.NET MVC 4 Beta with Web API - although I believe
I have a web application written in ASP .NET MVC 3. I'm using ACS

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.