public async Task <ActionResult <DNDMode> > PostDNDMode(DNDMode dNDMode) { _context.DNDModes.Add(dNDMode); await _context.SaveChangesAsync(); return(CreatedAtAction("GetDNDMode", new { id = dNDMode.Id }, dNDMode)); }
public async Task <IActionResult> PutDNDMode(int id, DNDMode dNDMode) { if (id != dNDMode.Id) { return(BadRequest()); } _context.Entry(dNDMode).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DNDModeExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }