public async Task <ActionResult <Action> > PostAction(Action action) { _context.Actions.Add(action); await _context.SaveChangesAsync(); return(CreatedAtAction("GetAction", new { id = action.Guid }, action)); }
public async Task <IActionResult> PutAction(Guid id, Action action) { if (id != action.Guid) { return(BadRequest()); } _context.Entry(action).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ActionExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }