Example #1
0
 public IActionResult OnGet()
 {
     ViewData["MoneyReceiverId"] = new SelectList(_context.MoneyReceiver, "Id", "ReceiverName");
     ViewData["MoneySenderId"]   = new SelectList(_context.MoneySender, "Id", "SenderName");
     ViewData["ProviderId"]      = new SelectList(_context.Set <Provider>(), "Id", "ProviderName");
     return(Page());
 }
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            MoneyTransfer = await _context.MoneyTransfer
                            .Include(m => m.MoneyReceiver)
                            .Include(m => m.MoneySender)
                            .Include(m => m.Provider).FirstOrDefaultAsync(m => m.Id == id);

            if (MoneyTransfer == null)
            {
                return(NotFound());
            }
            ViewData["MoneyReceiverId"] = new SelectList(_context.MoneyReceiver, "Id", "ReceiverName");
            ViewData["MoneySenderId"]   = new SelectList(_context.MoneySender, "Id", "SenderName");
            ViewData["ProviderId"]      = new SelectList(_context.Set <Provider>(), "Id", "ProviderName");
            return(Page());
        }