public async Task <IActionResult> PutAusgaben(int id, Ausgaben ausgaben) { if (id != ausgaben.Id) { return(BadRequest()); } _context.Entry(ausgaben).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AusgabenExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <Ausgaben> > PostAusgaben(Ausgaben ausgaben) { ausgaben.Datum = ausgaben.Datum.AddDays(1); _context.Ausgaben.Add(ausgaben); await _context.SaveChangesAsync(); return(CreatedAtAction("GetAusgaben", new { id = ausgaben.Id }, ausgaben)); }