public async Task <ActionResult <Goiabinha> > PostGoiabinha(Goiabinha goiabinha) { _context.Goiabinha.Add(goiabinha); await _context.SaveChangesAsync(); return(CreatedAtAction("GetGoiabinha", new { id = goiabinha.id }, goiabinha)); }
public async Task <IActionResult> Edit(int id, [Bind("id,nome,techLeader,horas,tickets")] Goiabinha goiabinha) { if (id != goiabinha.id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(goiabinha); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!GoiabinhaExists(goiabinha.id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(goiabinha)); }
public async Task <IActionResult> PutGoiabinha(int id, Goiabinha goiabinha) { if (id != goiabinha.id) { return(BadRequest()); } _context.Entry(goiabinha).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!GoiabinhaExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> Create([Bind("id,nome,techLeader,horas,tickets")] Goiabinha goiabinha) { if (ModelState.IsValid) { _context.Add(goiabinha); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(goiabinha)); }