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?