a solution is to use the .querybycube linq extension method provided by my product adaptivelinq.

disclaimer: i'm the adaptivelinq developer


for count it can be written as following:

private list generateimpl(ilist mylist, string field)
    iqueryable queryablelist = mylist.asqueryable();
    iqueryable groupedlist = queryablelist.groupby(field,"it").
                            orderby("key descending").
                            select("new (key as key, count() as count)");

    // note: iqueryable doesn't have tolist() implementation - only ienumerable 
    return output.tolist(); // will not work

for list - possible you'll need to add your custom implementation to dynamiclibrary... see how it was done for contains() method here

Related Query

More Query from same tag