public async Task <IActionResult> PutJournal(decimal id, Journal journal) { if (id != journal.Index) { return(BadRequest()); } _context.Entry(journal).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!JournalExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutRelease(decimal id, Release release) { if (id != release.Id) { return(BadRequest()); } _context.Entry(release).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ReleaseExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutPost(string id, Post post) { if (id != post.Author) { return(BadRequest()); } _context.Entry(post).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PostExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutRubricator(string id, Rubricator rubricator) { if (id != rubricator.Code) { return(BadRequest()); } _context.Entry(rubricator).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!RubricatorExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }