public async Task <ActionResult <DFestival> > PostDFestival(DFestival dFestival) { _context.Festival.Add(dFestival); await _context.SaveChangesAsync(); return(CreatedAtAction("GetDFestival", new { id = dFestival.Id }, dFestival)); }
public async Task <IActionResult> PutDFestival(int id, DFestival dFestival) { if (id != dFestival.Id) { return(BadRequest()); } _context.Entry(dFestival).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DFestivalExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }