Click here to Skip to main content
15,896,606 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello to everybody.

I have one problem. I have created new Silverlight Business Application project and added Domain Service Class in web project part. Now I want to write one method in Domain Service Class that returns IQueryable<myclass> and use it from Silverlight projects Client side. The data should be taken from remote WCF Service (hosted in IIS) and "myWcfClass" is also defined there (with SerializableAttribute and [Key] specified).

The method of Remote Service Class looks like this one:
C#
public IQueryable<mywcfclass> GetSomeList()
{
//this does not work because of GetmyWcfClass method returns myWcfClass[] type instead of List<mywcfclass>. is there any deal with it ???
       List<mywcfclass> = new Service1Client().GetmyWcfClass();
       . . . . . .
}</mywcfclass></mywcfclass></mywcfclass>

It does not matter what code is inside this method, when the compiler sees myWcfClass (through Web Service Reference I created for WCF Web Service) it shows the error:

Entity 'myBusinessApp.Web.RefRemoteWebService.myWcfClass' has a property 'ExtensionData' with an unsupported type.


I want to get something like this to work:
C#
[Query]
public IQueryable<mywcfclass> GetSomeList()
{
     List<mywcfclass> lst = new Service1Client().GetmyWcfClass();
     return lst.AsQueryable();
}</mywcfclass></mywcfclass>


With regards
Any help would be highly appreciated
Posted
Updated 17-Jul-10 3:27am
v4

Tragically, I don't think that will work. WCF will rely in having a serializable output from the method and IQueryable won't be. I'm afraid you can't really defer execution across a serialization boundary.

You could use IEnumerable<>, but when you generate your proxy you'll need to select how that will be exposed (Array or Generic List). If you pick generic list, you should be able to use the IQueryable methods again.
 
Share this answer
 
Thank you for your answer, maybe I not declared my problem well. and my code also is not showed exactly by this site. I'm using IQueryable<myclass> generic class, that was not shown.

C++
public IQueryable<myClass> GetSomeList()
this method is not defined in WCF Service, but exists in Domain Service Class, WCF Service returns just
C++
List<myClass>

(myClass resides in WCF), but in proxy myClass looks like different (there is ExtensionData of type System.Runtime.Serialization.ExtensionDataObject added for additional information) and Silverlight can't understand it as supported type for entities, to transfer it to Silverlight client

And also I want to tell that similar method
C++
public IQueryable<myLocalClass> GetSomeList()

Declared in Domain Service Class works fine and is transfered to Silverlight Client side well (myLocalClass is declared absolutely in the same way myClass in WCF Service is, but it resides within Domain Service Class's assembly)
 
Share this answer
 
v2
Comments
Sandeep Mewara 17-Jul-10 9:35am    
If you update the question using 'Improve Question' instead of posting an answer, it might help you getting more answers.
Ok, thank you very much everyone who tried to help or red my post. I solved this problem by just removing ExtensionData property from generated proxy version of my myClass type
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900