Пример #1
0
        public async Task <ActionResult <UserNameModel[]> > GetUsers(string name)
        {
            try
            {
                var result = await _repository.GetUsersInTeamAsync(name);

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