Example #1
0
        //This method returns dictionary including tips and their stats
        public async Task <ConcurrentDictionary <Tip, decimal[]> > GetTipStats(int TipTypeId)
        {
            ConcurrentDictionary <Tip, decimal[]> TipStats = new ConcurrentDictionary <Tip, decimal[]>();


            foreach (var item in await GetTipsByTipType(TipTypeId))
            {
                decimal Odds = await tipRepository.GetTipAverageOdds(item.TipId);

                decimal Total = await tipRepository.GetTipTotalPlayed(item.TipId);

                decimal Wins = await tipRepository.GetTipWins(item.TipId);

                if (Total != 0)
                {
                    TipStats.TryAdd(item, new decimal[] { Odds, Total, Wins });
                }
            }
            return(TipStats);
        }