Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to auto-load details (with conditions) associated with an entity using Ria Services?
    primarykey
    data
    text
    <p>I'm developing a project using Silverlight 4 and Entity Framework 4 and I'm trying to auto-load the details (with conditions) associated with an entity when the client loads the EntityQuery.</p> <p>So far, I've been able to put in place a solution, using the <em>Include</em> attribute, that returns <strong>all</strong> the details associated with the master entity. What I'm missing here is to be able to filter out the details based on some criteria. </p> <p>As an example, here's what my entities look like:</p> <p>Entity <strong>Movie</strong> </p> <pre><code>Id (int) [Include] MovieLocalizedInformations (EntityCollection&lt;MovieLocalizedInformation&gt;) </code></pre> <p>Entity <strong>MovieLocalizedInformation</strong></p> <pre><code>Id (int) Movie_Id (int) LanguageCode (eg.: en) Title </code></pre> <p>On my DomainService object, I expose the following method:</p> <pre><code>public IQueryable&lt;Movie&gt; GetMovies( string languageCode ) { return this.ObjectContext.Movies.Include( "MovieLocalizedInformations" ); } </code></pre> <p>This works fine. But when I try to add where clause to filter out the localized information based on the language code, only the movies get loaded on the client.</p> <p>Is there a way to achieve the filtering in one query?</p> <p>Note: I'm also using the <strong>DomainDataSource</strong> with <strong>paging</strong> on the client so the solution needs to work with that.</p> <p>Any help would be greatly appreciated!</p> <p>Thanks,</p> <p>Jacques.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    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.
    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