public async Task <ActionResult <Afire> > PostAfire(Afire afire) { _context.Afire.Add(afire); await _context.SaveChangesAsync(); return(CreatedAtAction("GetAfire", new { id = afire.Id }, afire)); }
public async Task <IActionResult> PutAfire(int id, Afire afire) { if (id != afire.Id) { return(BadRequest()); } _context.Entry(afire).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AfireExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }