I have a web service, that simply returns a lot of data over a method called GetAll()
.
Now what if I dont want all the data? What if I only want a few entities based on a query or some criteria. It feels kind of silly to send all the entities/objects and then handle the "querying" on the consumer side. It's a waste of bandwidth and it's also a waste of time since the query that queries the database for all objects/entities takes quite a while.
Would it be possible to somehow send a lambda-expression or something as an argument and then let the service query the database based on that expression, and then return a list of all the objects back to the consumer?