public async Task <IActionResult> PutTextendedDirection(byte id, TextendedDirection textendedDirection) { if (id != textendedDirection.TextendedDirectionId) { return(BadRequest()); } _context.Entry(textendedDirection).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TextendedDirectionExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <TextendedDirection> > PostTextendedDirection(TextendedDirection textendedDirection) { _context.TextendedDirection.Add(textendedDirection); try { await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (TextendedDirectionExists(textendedDirection.TextendedDirectionId)) { return(Conflict()); } else { throw; } } return(CreatedAtAction("GetTextendedDirection", new { id = textendedDirection.TextendedDirectionId }, textendedDirection)); }