Beispiel #1
0
        public async Task <IActionResult> GetAll()
        {
            IEnumerable <UserDto> usersDto = await _userUseCases.GetAll();

            IEnumerable <UserViewModel> usersVM = _mapper.Map <IEnumerable <UserDto>, IEnumerable <UserViewModel> >(usersDto);

            return(Ok(usersVM));
        }
Beispiel #2
0
        public async Task <IActionResult> Get()
        {
            try
            {
                var userDto = await _userUseCases.GetAll();

                return(Ok(userDto));
            }
            catch (Exception e)
            {
                return(BadRequest("Problema" + e.Message));
            }
        }