public T Update(T entity) { NullCheck(entity); _context.Update(entity); _context.SaveChanges(); return(entity); }
public async Task <IActionResult> Edit(string id, [Bind("FullName,Phone,Email,Company,Status,Id,DateCreated,CreatedBy")] Customer customer) { if (id != customer.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(customer); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CustomerExists(customer.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(customer)); }
protected static void updateAccount(string name1, string name2) { AccountEntity account = getAccount(name1); account.Name = name2; context.Update <AccountEntity>(account); context.SaveChanges(); }
public void Update(Usuario obj) { Db.Update(obj); Db.SaveChanges(); }