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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T10:44:36+00:00 2026-05-15T10:44:36+00:00

Hi I found problem with EF. Here is my Model I loaded asset: POCO.Asset

  • 0

Hi I found problem with EF.

Here is my Model

I loaded asset:

POCO.Asset asset = _context.Assets.Where(a => a.UID == assetUid).First();

then I go through all properties

foreach (POCO.Property p in asset.Properties) /* request to db */ { /*...*/ }

categories:

foreach (POCO.Category p in > asset.Categories) /* request to db */ { /*...*/ }

related assets:

foreach (POCO.Relation relatedAsset in entityAsset.Relations) /* request to db */ { /*...*/ }

all navigation properties work fine. I can see request to db through profile. everything is good.

but if I go through Relations and trying to load RelatedAssetProperties then I have a problem.
Basically my Asset has 4 relations and each relation has 2-3 properties.

foreach (POCO.Relation relatedAsset in entityAsset.Relations) /* request to db */
{
 /**/
 ICollection<RelatedAssetProperty> rap = relatedAsset.RelatedAssetProperties;
 foreach (RelatedAssetProperty relatedAssetProperty in rap)  /* request to db */
 {
  /**/
 }

}

During RelatedAssetProperties execution I see all 4 requests to db to get properties. I run all requests in SQL manager and each returns data.

But for some reason only for first relation rap has items (RelatedAssetProperty). For other Relations it is empty.

And I do not know why.

  • 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-15T10:44:36+00:00Added an answer on May 15, 2026 at 10:44 am

    Can you make sure that your entities have a primary key which makes sense ? I had a similar problem in a view where only the first recordset in the DB was returned.

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

Sidebar

Related Questions

Part of the solution to my problem I found here: How to calculate correlation
Related to a question I asked earlier here , I've found a problem which
Basically my problem is that i've adapted a piece of code found here http://social.msdn.microsoft.com/Forums/en-US/vemapcontroldev/thread/62e70670-f306-4bb7-8684-549979af91c1
My problem is in my navigation bar, which can be found here: http://grupocoral.netai.net/ There
I have found many questions here on SO and articles all over the internet
I've searched my problem high and low on here and haven't quite found the
I found this code from here: http://www.cssportal.com/form-elements/text-box.htm But the problem is you can still
We have encountered a very strange class not found problem in our web app
Seem to run into a service endpoint not found problem when trying to get
I'am currently working on GWTs Activity-Place implementation. Now I have found problem with the

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.