public async Task <IActionResult> PutUndertakenInitiatives([FromRoute] Guid id, [FromBody] UndertakenInitiatives undertakenInitiatives) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != undertakenInitiatives.UndertakenInitiativeID) { return(BadRequest()); } _context.Entry(undertakenInitiatives).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UndertakenInitiativesExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
//update public Tuple <string, int> AnimeDatabase_Update_Description(AnimeDatabase_Description updatedDescription) { using (var context = new ADContext()) { context.Entry(updatedDescription).State = EntityState.Modified; return(new Tuple <string, int>(updatedDescription.description, context.SaveChanges())); } }
//update public Tuple <string, int> AnimeDatabase_Update_Anime(AnimeDatabase_Anime newAnime) { using (var context = new ADContext()) { context.Entry(newAnime).State = EntityState.Modified; return(new Tuple <string, int>(newAnime.AnimeName, context.SaveChanges())); } }