public async Task <IEnumerable <UserResponseModel> > Get() { var query = new GetAllUsersQueryRequest(); var response = await mediator.Send(query); return(response); }
public async Task <IActionResult> GetAllUsers() { var request = new GetAllUsersRequest(); var model = new GetAllUsersQueryRequest { TransferObject = request }; var result = await Mediator.Send(model); return(HandleResponse(result, r => r)); }
//[Ignore] public async Task GetAllUsers() { var getAllUsers = UserHelper.GetAllUsers(); var model = new GetAllUsersQueryRequest { TransferObject = getAllUsers }; var result = await _mediator.Send(model); result.Status.ShouldBe(EnumOperationResult.Ok); }
public async Task <OperationResult <GetAllUsersQueryResponse> > Handle(GetAllUsersQueryRequest request, CancellationToken cancellationToken) { var response = new GetAllUsersQueryResponse(request.MessageId); OperationResult <GetAllUsersQueryResponse> result; response.Result = await(from u in _dbContext.UserAccount select new UserResponse { UserAccountId = u.UserAccountId, FirstName = u.FirstName, LastName = u.LastName, Email = u.Email, ContactNumber = u.ContactNumber, SystemProfileId = u.SystemProfileId, Username = u.Username, AcceptedTerms = u.AcceptedTerms, KnownAs = u.KnownAs, SystemProfile = u.SystemProfile.DisplayName }).ToListAsync(); result = new OperationResult <GetAllUsersQueryResponse>(EnumOperationResult.Ok, null, response); return(result); }
public async Task <IEnumerable <UserResponseModel> > Handle(GetAllUsersQueryRequest request, CancellationToken cancellationToken) { var response = this.repository.GetAll(); return(response); }