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

  • Home
  • SEARCH
  • 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 3343614
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T00:58:30+00:00 2026-05-18T00:58:30+00:00

In my Silverlight app, after creating ADO.NET Entity Data Model and WCF RIA Services

  • 0

In my Silverlight app, after creating ADO.NET Entity Data Model and WCF RIA Services Domain Service Class, in a corresponding ProductService class I have a query operation that returns a collection of Product entities to the client, as follows:

public IQueryable<Product> GetProducts()
{
   return this.ObjectContext.Products;
}

Now I’m trying to read it in the client Silverlight app and load results to an ObservableCollection:

ProductContext pcontext = new ProductContext();
ObservableCollection<Prod> prAvs = pcontext.GetProductsQuery();

But getting an error:

Cannot implicitly convert type System.ServiceModel.DomainServices.Client.EntityQuery<MyTestApp.Web.Product>
to System.Collections.ObjectModel.ObservableCollection<MyTestApp.Prod>

How could I fix that issue?

  • 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-18T00:58:31+00:00Added an answer on May 18, 2026 at 12:58 am

    First problem:

    You should be using the client-side Products class generated for you by RIA services, not another class you define yourself.

    e.g you should have a collection of MyTestApp.Web.Product, not of MyTestApp.Prod objects.

    You will find the generated domain context in a hidden Generated_Code folder in your client project. Within that will be a MyTestApp.Web.g.cs file containing the client side context and any data objects (like MyTestApp.Web.Product).

    Second issue:

    You can’t just cast a query to a collection.

    You need to use the query to load an entity change-set instead.

    var loadOperation = pcontext.Load(pcontext.GetProductsQuery());
    

    The result (when the load completes) is an entity collection in the returned loadOperation object. You can use the entity collection immediately, but it is initially empty.

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

Sidebar

Related Questions

I'm currently working on a Silverlight app and need to convert XML data into
We're using Silverlight 2 with ADO.NET dataservices and to test the silverlight page we
Im attempting to use Silverlight and MVC together. After creating a simple Silverlight application
After a user installs a silverlight app out of the browser, can they copy
I recently upgraded my Silverlight app from 3 to 4. After a few hours
I have a Silverlight App which gets its data from a database. My Silverlight
I've got a Silverlight app that talks to an HTTPS web service. On most
I implemented the following Silverlight app after seeing this instructions , here's my code:
I have a silverlight app that uses WCF both by polling Duplex and normal
I'm currently trying out Silverlight with RIA Services. I'm implementing a simple login form.

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.