Here's an interesting problem that I hope someone can lend a hand with.
I have a DomainService class with the following query:
[Query]
public IEnumerable<BatchResult> GetBatchResults(int batchId)
{
return ObjectContext.BatchQueries
.Include("BatchTCResults")
.Include("BatchANFResults")
.Where(x => x.BatchId == batchId)
.Where(x => x.BatchTCResults.Any() || x.BatchANFResults.Any())
.ToArray() // enumerate because projection calls a method that EF will poop it's pants on
.Select(x => new BatchResult
{
BatchQueryId = x.Id,
Route = x.Routing,
Account = x.Account,
Amount = x.Amount,
CheckNumber = x.CheckNumber,
Severity = BatchResult.DetermineOverallSeverity(x)
});
}
This works BUT I really need the paging/sorting information passed from the Silverlight client to be applied before enumeration happens in the line calling .ToArray()
The client side is using the DomainDataSource Silverlight control.
How can I achieve this?