public async Task <IActionResult> Edit(Guid id, [Bind("Id")] ContractsSent contractsSent) { if (id != contractsSent.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(contractsSent); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ContractsSentExists(contractsSent.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(contractsSent)); }
public async Task <IActionResult> Create([Bind("Id")] ContractsSent contractsSent) { if (ModelState.IsValid) { contractsSent.Id = Guid.NewGuid(); _context.Add(contractsSent); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(contractsSent)); }