public async Task<IActionResult> Edit(Devices devices) { if (ModelState.IsValid) { _context.Update(devices); await _context.SaveChangesAsync(); return RedirectToAction("Index"); } return View(devices); }
public async Task<IActionResult> Create(Devices devices) { devices.ActivationDate = System.DateTime.Now; if (ModelState.IsValid) { _context.Devices.Add(devices); await _context.SaveChangesAsync(); return RedirectToAction("Index"); } return View(devices); }