private async Task SaveGoalieStatistics(IList <GamePageGoalieStats> goalieStatistics, Guid gameId, Guid teamId) { foreach (var statistic in goalieStatistics) { var player = await GetOrCreatePlayer(statistic.GoalieName); GameGoalieStatisticDTO goalieStatistic = new GameGoalieStatisticDTO { GameId = gameId, GoalsAllowed = statistic.GoalsAgainst, ShotsAgainst = statistic.ShotsAgainst, Saves = statistic.Saves, PlayerId = player.Id, TeamId = teamId, Result = GetGoalieResult(statistic), CreatedOnUtc = DateTime.Now }; await _gameGoalieStatisticService.Upsert(goalieStatistic); } }
public async Task <IActionResult> Post([FromBody] GameGoalieStatisticDTO value) { IActionResult result = await Execute(_log, async() => await _gameGoalieStatisticService.Upsert(value)); return(result); }