public async Task <ActionResult <BagLetters> > PostBagLetters(BagLetters bagLetters) { _context.BagLetters.Add(bagLetters); await _context.SaveChangesAsync(); return(CreatedAtAction("GetBagLetters", new { id = bagLetters.Id }, bagLetters)); }
public async Task <IActionResult> PutBagLetters(Guid id, BagLetters bagLetters) { if (id != bagLetters.Id) { return(BadRequest()); } _context.Entry(bagLetters).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BagLettersExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }