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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T05:11:20+00:00 2026-05-16T05:11:20+00:00

I am having a very tough time with this one. I have a Navigation

  • 0

I am having a very tough time with this one. I have a Navigation property called Attachment that is part of an entity called ContentChannel. ContentChannel is a many to one relationship with KioskType.

In my domain service extension class, I have the following query:

public IQueryable<ContentChannel> GetContentChannelFromKioskType( long kioskTypeID )
{
    var returnSet = (from cc in ObjectContext.ContentChannels.Include( "Attachment" )
                   join pcc in ObjectContext.PublishedContentChannels on cc.ContentChannelID equals pcc.ContentChannelID
                        where pcc.KioskTypeID == kioskTypeID
                        select cc);
    return returnSet;
}

And this works just fine for returning the list of ContentChannels. But the Attachment in each ContentChannel is null.

I have tried [Include] on the attachment property in my ContentChannel metadata class, in conjuction with ContentChannels.Include("Attachment") in the above query- no luck, Attachment is always null.

I dug more and then found something to explicitly load my child item:

ObjectContext.LoadProperty( returnSet, "Attachment" );

But this generates the following error:

Cannot explicitly load property for entities that are detached. Objects loaded using the NoTracking merge option are always detached.

Is it because I’m doing a join that things are wonky and the Include doesnt work? What do I need to do? These attachments need to get loaded when I get a ContentChannel!

Any thoughts?

  • 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-16T05:11:21+00:00Added an answer on May 16, 2026 at 5:11 am

    By including the join in your query, you’ve changed the shape of the query, after the Include. So the Include is discarded. But you don’t need the join:

    public IQueryable<ContentChannel> GetContentChannelFromKioskType( long kioskTypeID )
    {
        var returnSet = (from cc in ObjectContext.ContentChannels.Include( "Attachment" )
                         where cc.PublishedContentChannels.Any(pcc => pcc.KioskTypeID == kioskTypeID)
                         select cc);
        return returnSet;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having a very tough time debugging a multi-threaded C application that I've made
Im having a very strange problem, i have a complicated view that returns incorrect
I am running JSF 2.0 I currently have one java controller that is called
I'm having a very big struct in an existing program. This struct includes a
I've been having a very hard time finding good examples of UIScrollView. Even Apple's
I have a ban list that I'm building as part of an application that
I am still new at PHP/Javascript/Ajax and am having a very hard time (been
I have a class that looks like this: class SearchService include Mongoid::Document key :name,
File systems are volatile. This means that you can't trust the result of one
Im having a very odd problem. Im trying to install a Python program. Im

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.