Esempio n. 1
0
        public IActionResult AddTeam([FromBody] TeamDto team)
        {
            var isTeamAdded = _dataStore.TryAddingTeam(team.ToEntity());

            if (isTeamAdded)
            {
                _dataStore.SaveChanges();
                return(Ok($"Team {team.Name} added successfully."));
            }

            return(BadRequest());
        }
Esempio n. 2
0
        public async Task <Team> GetTeam(int id)
        {
            TeamDto teamdto = await _TeamRepository.GetTeam(id);

            return(teamdto.ToEntity());
        }