public async Task <MatchModel> CreateMatch([FromBody] CreateMatchCommand command)
        {
            if (command == null)
            {
                throw new ArgumentException(nameof(command));
            }

            return(await matchService.CreateMatch(command));
        }
Exemple #2
0
        public async Task <IActionResult> CreateMatch(MatchdayForCreationDto matchdayForCreation, int userId)
        {
            if (userId != int.Parse(User.FindFirst(ClaimTypes.NameIdentifier).Value))
            {
                return(Unauthorized());
            }

            return(Ok(await _matchesService.CreateMatch(matchdayForCreation, userId)));
        }