public async Task <IActionResult> GetUsers(string searchName) { try { var response = await _businessLogic.GetAllUsers(searchName); var responseMapped = _mapper.Map <IEnumerable <BlUsersResponse>, IEnumerable <UsersResponse> >(response); return(Ok(responseMapped)); } catch (Exception e) { return(BadRequest(e.Message)); } }
public UserDto[] GetAllUsers() { List <ApplicationUser> users; try { users = _userBusinessLogic.GetAllUsers(); } catch (Exception ex) { this.Log.Error(LogHelper.GetMethodInfoErrorMessage(MethodBase.GetCurrentMethod()), ex); throw new FaultException(); } UserDto[] usersDtos = Mapper.Map <UserDto[]>(users); return(usersDtos); }