Exemple #1
0
        public async Task <IActionResult> Post(MatchDto matchDto)
        {
            try
            {
                var match = await _matchService.Add(matchDto);

                return(CreatedAtAction("Get", new { id = match.Id }, match));
            }
            catch (FluentValidationException ve)
            {
                return(ValidationError(ve));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }