public async Task <ActionResult <SlotPattern> > PostSlotPattern(SlotPattern slotPattern) { _context.SlotPattern.Add(slotPattern); await _context.SaveChangesAsync(); return(CreatedAtAction("GetSlotPattern", new { id = slotPattern.Id }, slotPattern)); }
public async Task <IActionResult> PutSlotPattern(int id, SlotPattern slotPattern) { if (id != slotPattern.Id) { return(BadRequest()); } _context.Entry(slotPattern).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SlotPatternExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }