Im doing a proof of concept on wcf and mvc. And I got some questions:
Is there already a built-in solution for handling sorting/filtring in WCF? Or do i have to do somthing like this, optional sorting class:
[OperationContract]
Invoice GetInvoices(SortingClass criteria);
Is there a build-in solution for lazyloading in WCF, or use lazyloading patterns?
I wanna do all sorting/filtring on the serverside to have more control and unit test friendly enviroment.
-
Sorting and filtering and WCF have nothing to do with eachother. WCF is about communication between processes. What you communicate about isn't interesting from the WCF point of view.
So you have to implement sorting and filtering yourself (as in most cases). There is nothing wrong with providing a parameter that specifies your sorting criteria.
As for lazy loading, I suppose you would want to do something like this?
- get object
afrom web service and load all primitive properties - on the client call
a.ListOfObjects ListOfObjectsfor instanceais automagically loaded from the web service
This is also something you have to do yourself. You could take a look at ADO.NET Data Services for this. No lazy-loading but a similar pattern.
larole : thanks for the fast reply. Guess the same goes for lazy loading?larole : thanks again, very helpful - get object
0 comments:
Post a Comment