public override void Update(WebContent entity) { var dbEntityEntry = context.Entry(entity); entity.ModifiedDate = DateTime.Now; if (dbEntityEntry.State != EntityState.Detached) { dbEntityEntry.State = EntityState.Modified; } dbEntityEntry.State = EntityState.Modified; context.SaveChanges(); }
public async Task <IActionResult> PutDivision(int id, Division division) { if (id != division.DivisionID) { return(BadRequest()); } _context.Entry(division).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DivisionExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutWebContentType(int id, WebContentType webContentType) { if (id != webContentType.WebContentTypeId) { return(BadRequest()); } _context.Entry(webContentType).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!WebContentTypeExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
PutWebContent(int id, WebContent webContent) { if (id != webContent.WebContentId) { return(BadRequest()); } _context.Entry(webContent).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!WebContentExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }