У меня есть попытка модели:
Код: Выделить всё
public class Attempt(int Id, string UserId, int score)
{
public int Id { get; set; } = Id;
public string UserId { get; set; } = UserId!;
public int score { get; set; } = score;
}
Код: Выделить всё
IQueryable GetBestAttempts() =>
db.Attempt
.GroupBy(a => a.UserId)
.Select(g => g.OrderByDescending(attempt => attempt.score).First())
.OrderByDescending(attempt => attempt.score)
.ThenBy(attempt => attempt.UserId);
Код: Выделить всё
System.Collections.Generic.KeyNotFoundException: 'The given key 'EmptyProjectionMember' was not present in the dictionary.'
Подробнее здесь: https://stackoverflow.com/questions/791 ... -was-not-p
Мобильная версия