public async Task <IActionResult> OnPostDelete(int ID) { var Connection = _db.ConnectionsItems.Find(ID); _db.ConnectionsItems.Remove(Connection); await _db.SaveChangesAsync(); return(RedirectToPage()); }
public async Task <IActionResult> OnPost() { if (ModelState.IsValid) { await _db.SaveChangesAsync(); afterAddMessage = "List item updated successfully!"; return(RedirectToPage("Index")); } else { return(RedirectToPage()); } }
public async Task <IActionResult> Onpost() { if (!ModelState.IsValid) { return(Page()); } else { _db.ConnectionsItems.Add(ConnectionsTest); await _db.SaveChangesAsync(); afterAddMessage = "!new connection made!"; return(RedirectToPage("index")); } }
public async Task <IActionResult> OnPost() { if (ModelState.IsValid) { var connectionInDb = _db.ConnectionsItems.Find(Connections.ID); connectionInDb.Connections = Connections.gamerGamer; connectionInDb.ConnectionDescription = Connections.GameGame; await _db.SaveChangesAsync(); afterAddMessage = "List item updated successfully!"; return(RedirectToPage("Index")); } else { return(RedirectToPage()); } }