public async Task <IActionResult> OnGetAsync() { ViewData["EventInfoId"] = new SelectList(await _eventInfoRetrievalService.GetAllEventsAsync(), "EventInfoId", "Slug"); ViewData["PaymentMethod"] = new SelectList(await _paymentMethods.GetActivePaymentMethodsAsync(), "Provider", "Name"); ViewData["UserId"] = new SelectList(await _userListingService.ListUsersAsync(), "Id", "Id"); return(Page()); }
public async Task <IActionResult> GetUsers() { var users = (await _userRetrievalService.ListUsersAsync()) .Select(u => new { u.Id, u.Name, u.Email, Phone = u.PhoneNumber }) .ToList(); return(Ok(users)); }
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.GetAllEventsAsync(), "EventInfoId", "Slug"); ViewData["PaymentMethod"] = new SelectList(await _paymentMethods.GetActivePaymentMethodsAsync(), "Provider", "Name"); ViewData["UserId"] = new SelectList(await _userListingService.ListUsersAsync(), "Id", "Id"); return(Page()); }