public async Task <IActionResult> Edit(int id, [Bind("Id,StudentId,StudentEmail,Action,ProductName,ProductKey,TimeStamp")] ProductKeyLog productKeyLog) { if (id != productKeyLog.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(productKeyLog); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProductKeyLogExists(productKeyLog.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(productKeyLog)); }
public async Task <IActionResult> Create([Bind("Id,StudentId,StudentEmail,Action,ProductName,ProductKey,TimeStamp")] ProductKeyLog productKeyLog) { if (ModelState.IsValid) { _context.Add(productKeyLog); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(productKeyLog)); }