public async Task <IActionResult> Edit(int id, [Bind("HsOwnerId,eMail,Name,WorkOrderId")] HsOwner hsOwner) { if (id != hsOwner.HsOwnerId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(hsOwner); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!HsOwnerExists(hsOwner.HsOwnerId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(hsOwner)); }
public async Task <IActionResult> Create([Bind("HsOwnerId,eMail,Name,WorkOrderId")] HsOwner hsOwner) { if (ModelState.IsValid) { _context.Add(hsOwner); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(hsOwner)); }