Example #1
0
        public IActionResult OnGet()
        {
            var members = _context.Set <Member>().Select(m => new
            {
                MemberId       = m.MemberId,
                NameAndPhoneNo = $"{m.Name} ({m.PhoneNo})"
            })
                          .ToList();

            ViewData["MemberId"] = new SelectList(members, "MemberId", "NameAndPhoneNo");
            return(Page());
        }
Example #2
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            QueueEntry = await _context.QueueEntries
                         .Include(q => q.Member).FirstOrDefaultAsync(m => m.Id == id);

            if (QueueEntry == null)
            {
                return(NotFound());
            }
            var members = _context.Set <Member>().Select(m => new
            {
                MemberId       = m.MemberId,
                NameAndPhoneNo = $"{m.Name} ({m.PhoneNo})"
            })
                          .ToList();

            ViewData["MemberId"] = new SelectList(members, "MemberId", "NameAndPhoneNo");
            return(Page());
        }