Is there any way to return an array of objects of type
DynamicClass from WCF method?
I'm using Dynamic Linq Library in my WCF service, so as to
select columns of database table , as per the request from clients. The client code should look like this:
//client side code string whereClause = "FeatureId >= 6 and FeatureId <= 180"; string selectClause = "New(FeatureName as Name, FeatureId as Id)"; client.RequestAsync("Feature", "FeatureDB", whereClause, selectClause);
Feature is the name of the table from which I want to
select two columns only, viz. FeatureName and FeatureId, satisfying the condition in the
Here, the problem is that the query runs fine on the server, but WCF is unable to send it back to the client. My guess is that the dynamically created class which defines only the selected columns is not declared
DataContract, so WCF isn't able to work with it.
So any solution to this problem?
Or any alternative? The goal is, I don't want to return all columns of the database table, because I don't need all of them on the client side. So I don't see any point sending all columns back to the client, who will discard it anyway.