views:

318

answers:

1

How can i do dynamic group by in linq to objects in #siverlight client side?

i want to do something like this:

var x = "empt.Dept";

var groups = from emp in employees
         group emp by x into g
select new { Dept = g.Key, Count = g.Count() };

I tryed also to use reflection and do something like employee.GetType().GetProperty("Dept") but didn't work.

any ideas woudl be great, i already when throught dynamic Linq extensions, but they don't compile on the silverlight client side, since there are some RegisterLockMethods that aren't in System.Threathing on Silverlight.

Thanks in advance

Rui

A: 

http://skysigal.xact-solutions.com/Blog/tabid/427/EntryId/1139/LINQ-Dynamic-Queries.aspx

Donal
this is for server side.. that library doesn't work on silverlight
Rui Marinho