Exemple #1
0
        public async Task <ActionResult <UserDTO[]> > GetString(string token)
        {
            try
            {
                var results = await UnitOfWork.GetAllUsersByLastNameAsync(token);

                if (!results.Any())
                {
                    return(NotFound());
                }

                return(Mapper.Map <UserDTO[]>(results));
            }
            catch (Exception)
            {
                return(this.StatusCode(StatusCodes.Status500InternalServerError, "Database Failure"));
            }
        }