Пример #1
0
        public async Task <IActionResult> Get()
        {
            try
            {
                var ratings = await _ratingsRepository.Get();

                return(Ok(ratings));
            }
            catch (Exception)
            {
                return(new StatusCodeResult(500));
            }
        }
Пример #2
0
        public async Task <Dictionary <string, int> > Get()
        {
            var ratings = await _ratingsRepository.Get();

            return(ratings
                   .Select((x, i) => (x, i + 1))
                   .ToDictionary(t => $"Reviewer{t.Item2}", x => x.x.Rating));
        }
Пример #3
0
 public Task <Rating> GetRating(string companySymbol)
 {
     return(_ratingsRepository.Get(companySymbol));
 }