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