Note that there are some explanatory texts on larger screens.

plurals
  1. POEntity Framework does not return object
    primarykey
    data
    text
    <p>Hi I found problem with EF.</p> <p>Here is my <a href="http://www.freeimagehosting.net/image.php?66091617f9.jpg" rel="nofollow noreferrer">Model</a></p> <p>I loaded asset:</p> <pre><code>POCO.Asset asset = _context.Assets.Where(a =&gt; a.UID == assetUid).First(); </code></pre> <p>then I go through all properties</p> <pre><code>foreach (POCO.Property p in asset.Properties) /* request to db */ { /*...*/ } </code></pre> <p>categories:</p> <pre><code>foreach (POCO.Category p in &gt; asset.Categories) /* request to db */ { /*...*/ } </code></pre> <p>related assets:</p> <pre><code>foreach (POCO.Relation relatedAsset in entityAsset.Relations) /* request to db */ { /*...*/ } </code></pre> <p>all navigation properties work fine. I can see request to db through profile. everything is good.</p> <p>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.</p> <pre><code>foreach (POCO.Relation relatedAsset in entityAsset.Relations) /* request to db */ { /**/ ICollection&lt;RelatedAssetProperty&gt; rap = relatedAsset.RelatedAssetProperties; foreach (RelatedAssetProperty relatedAssetProperty in rap) /* request to db */ { /**/ } } </code></pre> <p>During RelatedAssetProperties execution I see all 4 requests to db to get properties. I run all requests in SQL manager and each returns data.</p> <p>But for some reason only for first relation rap has items (RelatedAssetProperty). For other Relations it is empty.</p> <p>And I do not know why.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload