Запрос Linq с СУММОЙ и ORDER BY

Чтобы получить значение List joinTeams, вы можете использовать GET https://graph.microsoft.com/v1.0/me/joinedTeams в API графа MS .

enter image description here

Необходимые разрешения:

enter image description here Подробнее см. до здесь .

13
задан BFree 4 May 2009 в 15:47
поделиться

2 ответа

var q = (from h in hits
    group h by new { h.ItemID } into hh
    select new {
        hh.Key.ItemID,
        Score = hh.Sum(s => s.Score)
    }).OrderByDescending(i => i.Score);
12
ответ дан 2 December 2019 в 00:03
поделиться
IEnumerable<Hit> result = hits.
   GroupBy(hit => hit.ItemID).
   Select(group => new Hit 
                   {
                      ItemID = group.Key,
                      Score = group.Sum(hit => hit.Score)
                   }).
   OrderByDescending(hit => hit.Score);
4
ответ дан 2 December 2019 в 00:03
поделиться
Другие вопросы по тегам:

Похожие вопросы: