Пример #1
0
        public IEnumerable <TopSubmitterDto> TopSubmitters()
        {
            try
            {
                var topSubmitters = _submissionsService.GetTop5Submitters();

                var topSubmitterDtos = topSubmitters.Select(topSubmission => new TopSubmitterDto()
                {
                    Nickname              = topSubmission.Nickname,
                    SolvedTasks           = topSubmission.SolvedTasks,
                    SuccessfulSubmissions = topSubmission.SuccessfulSubmissions
                });

                return(topSubmitterDtos);
            }
            catch (Exception exception)
            {
                _logger.LogError(exception.Message);
                throw;
            }
        }