Exemple #1
0
        private async Task DoCacheRushingAsync(PlayerBaseRushingStatsModel player)
        {
            var playerModel = await _playersCacheRepository.Get(player.Id) ?? new PlayerModel(player.Id, player.EntryId, player.Name, player.Position);

            playerModel.Rushing = new RushingModel
            {
                Att = player.Att,
                Fum = player.Fum,
                Tds = player.Tds,
                Yds = player.Yds
            };

            _playersCacheRepository.Put(player.Id, playerModel);

            _logger.LogInformation($"player {playerModel.Id} Rushing stats added.");
        }
 /// <summary>
 /// Return a single player
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public async Task <PlayerModel> GetPlayerById(string id)
 {
     return(await _playersCacheRepository.Get(id));
 }