public async Task <IActionResult> PutLetter(string id, Letter letter) { if (id != letter.LetterName) { return(BadRequest()); } _context.Entry(letter).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LetterExists(id, letter.SectionID)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutTemplate(int id, Template template) { if (id != template.Id) { return(BadRequest()); } _context.Entry(template).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TemplateExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }