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