コード例 #1
0
        public async Task <ActionResult> AddTeamAsync([FromBody] TeamModel team)
        {
            try
            {
                if (team != null)
                {
                    await _teamManager.AddTeamAsync(team);

                    return(Ok());
                }
                else
                {
                    return(BadRequest("Team payload cannot be empty"));
                }
            }
            catch (Exception ex)
            {
                _logger.LogError(ex, $"Error adding team with message: {ex.Message}");
                return(BadRequest(ex.Message));
            }
        }