Is any way to translate GridView filtering and sorting e t.c. options to the WCF Service so Service Method could do the things in LINQtoSQL datacontext? I just want to call Wcf Services in RIA manner
For example, at SilverLight Client Control we call the service method:
And at the Wcf Service:
I found the class VirtualQueryableCollectionView. Could it help me?
I do not want to use RIA services because:
1) I want to call service synchronously in my customized SilverLight thread like this:
(i'm using my own tool, which generates wcf sync proxies)
2) The code is more clear.
3)I want to load and store some advanced data in the entities
For example, at SilverLight Client Control we call the service method:
//SilverLight Client Control with DataGrid:
public
class
MyControl : UserControl
{
...
private
IEnumerable<Employee> Search(GridViewOptions options)
{
var asyncResult = myService.BeginGetEmployees(options);
return
myService.EndGetEmployees(asyncResult);
}
...
}
And at the Wcf Service:
[OperationContract]
public
Employee[] GetEmployees(GridViewOptions options)
{
using
(var db =
new
DB()) //DB is the LinqToSql DataContext
{
return
db.Employees
.ApplyGridOptions(options)
//this is the thing i want
.BeforeSending() //it's my own method, which caches some related data, and fills custom fields in partial class Employee
.ToArray();
}
}
I do not want to use RIA services because:
1) I want to call service synchronously in my customized SilverLight thread like this:
DoWork(
"Loading Genres..."
,(sender, args) =>
{
args.Result = Communication.Proxy.GetGenres();
},(o, eventArgs) =>
{
if
(eventArgs.Error==
null
)
{
genreGrid.ItemsSource = eventArgs.Result;
}
});
(i'm using my own tool, which generates wcf sync proxies)
2) The code is more clear.
3)I want to load and store some advanced data in the entities