public async Task <IActionResult> Get() { try { var ratings = await _ratingsRepository.Get(); return(Ok(ratings)); } catch (Exception) { return(new StatusCodeResult(500)); } }
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)); }
public Task <Rating> GetRating(string companySymbol) { return(_ratingsRepository.Get(companySymbol)); }