示例#1
0
        public async Task <ActionResult <TeamModel> > Get(int id)
        {
            try
            {
                var result = await _repository.GetTeamByIdAsync(id);

                if (result == null)
                {
                    return(NotFound("Team not found!"));
                }
                return(_mapper.Map <TeamModel>(result));
            }
            catch (Exception)
            {
                return(StatusCode(StatusCodes.Status500InternalServerError, "Database failure!"));
            }
        }