public async Task <IActionResult> PutgetIncome([FromRoute] int id, [FromBody] getIncome getIncome) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != getIncome.id_getIncome) { return(BadRequest()); } _context.Entry(getIncome).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!getIncomeExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PostgetIncome([FromBody] getIncome getIncome) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.getIncome.Add(getIncome); await _context.SaveChangesAsync(); return(CreatedAtAction("GetgetIncome", new { id = getIncome.id_getIncome }, getIncome)); }