public async Task <IActionResult> PutUsers(int id, Users users) { if (id != users.Id) { return(BadRequest()); } _context.Entry(users).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UsersExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutExpenseCategory(int id, ExpenseCategory expenseCategory) { if (id != expenseCategory.Id) { return(BadRequest()); } _context.Entry(expenseCategory).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ExpenseCategoryExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }