public async Task <IActionResult> Edit(int id, [Bind("Id,SenderName,MobileNumber")] MoneySender moneySender) { if (id != moneySender.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(moneySender); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MoneySenderExists(moneySender.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(moneySender)); }
public async Task <IActionResult> Create([Bind("Id,SenderName,MobileNumber")] MoneySender moneySender) { if (ModelState.IsValid) { _context.Add(moneySender); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(moneySender)); }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } MoneySender = await _context.MoneySender.FirstOrDefaultAsync(m => m.Id == id); if (MoneySender == null) { return(NotFound()); } return(Page()); }