Killing Two Birds with One Stone in RIA Services Using Silverlight

Here's the problem:

The database is heavily standardized, and one particular query is based on multiple relationships in the database. The query is designed to combine all tables, build the entire object and then return a list of these objects.

In other words, this particular query does a great job.

Now the query returns only the number of X elements, since it supports pagination, but we also need to know the total number of elements that are there.

Currently, these two tasks are independent, but very similar requests in our domain service. Ideally, I would like to combine these two requests so that the server is called once, not twice, and that connections only happen once.

The output / link options do not work, and since the function is designed to return an IQueryable object, I focused on how to return this list of elements, as well as the total number.

I'm sure someone has come across this before - any thoughts?

+3
source share
2 answers

The number of merged element tables is not the same as returning a subset of these records. They just have to share a certain amount of SQL code (in particular, join tables). RIA makes a real paging server page, so you actually get a slightly different request for each paging call.

, , SQL ( Linq ... Linq!).

( , ), , .

( ) . - ( ..).

: - .

+1

, .

0

Source: https://habr.com/ru/post/1766989/


All Articles