public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } _context.Attach(UserAddress).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UserAddressExists(UserAddress.Id)) { return(NotFound()); } else { throw; } } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } _context.Cryptocurrency.Add(Cryptocurrency); await _context.SaveChangesAsync(); return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } Cryptocurrency = await _context.Cryptocurrency.FindAsync(id); if (Cryptocurrency != null) { _context.Cryptocurrency.Remove(Cryptocurrency); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } UserAddress = await _context.UserAddress.FindAsync(id); if (UserAddress != null) { _context.UserAddress.Remove(UserAddress); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }