public async Task <IActionResult> OnGetAsync()
 {
     ViewData["EventInfoId"]   = new SelectList(await _eventInfoRetrievalService.ListEventsAsync(), "EventInfoId", "Code");
     ViewData["PaymentMethod"] = new SelectList(await _paymentMethods.GetActivePaymentMethodsAsync(), "Provider", "Name");
     ViewData["UserId"]        = new SelectList(await _userListingService.ListUsers(), "Id", "Id");
     return(Page());
 }
        public async Task <IActionResult> GetUsers()
        {
            var users = (await _userRetrievalService.ListUsers())
                        .Select(u => new { u.Id, u.Name, u.Email, Phone = u.PhoneNumber })
                        .ToList();

            return(Ok(users));
        }
 public static async Task <List <ApplicationUser> > ListUsersAsync(
     this IUserRetrievalService userRetrievalService)
 {
     return((await PageReader <ApplicationUser> .ReadAllAsync(
                 (offset, limit, token) => userRetrievalService
                 .ListUsers(new UserListRequest
     {
         Limit = limit,
         Offset = offset
     }, UserRetrievalOptions.Default, token)))
            .ToList());
 }
Пример #4
0
        public async Task <PageResponseDto <UserDto> > List(
            [FromQuery] UsersQueryDto request,
            CancellationToken cancellationToken)
        {
            var paging = await _userRetrievalService
                         .ListUsers(
                new UserListRequest
            {
                Filter     = request.ToUserFilter(),
                Limit      = request.Limit,
                Offset     = request.Offset,
                OrderBy    = request.Order,
                Descending = request.Descending
            },
                UserRetrievalOptions.Default,
                cancellationToken);

            return(PageResponseDto <UserDto> .FromPaging(
                       request, paging, u => new UserDto(u)));
        }
Пример #5
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Registration = await _context.Registrations
                           .Include(r => r.EventInfo)
                           .Include(r => r.User)
                           .SingleOrDefaultAsync(m => m.RegistrationId == id);

            if (Registration == null)
            {
                return(NotFound());
            }
            ViewData["EventInfoId"]   = new SelectList(await _eventInfoRetrievalService.ListEventsAsync(), "EventInfoId", "Code");
            ViewData["PaymentMethod"] = new SelectList(await _paymentMethods.GetActivePaymentMethodsAsync(), "Provider", "Name");
            ViewData["UserId"]        = new SelectList(await _userListingService.ListUsers(), "Id", "Id");
            return(Page());
        }