public IHttpActionResult PutPhotoAlbum(int id, PhotoAlbum photoAlbum) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != photoAlbum.PhotoAlbumId) { return(BadRequest()); } db.Entry(photoAlbum).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!PhotoAlbumExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <IActionResult> PutAccess([FromRoute] int id, [FromBody] Access access) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != access.AccessId) { return(BadRequest()); } _context.Entry(access).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AccessExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public void Insert(Component obj) { accessContext.Components.Add(obj); accessContext.Entry(obj).State = EntityState.Added; }
public void Insert(Admin obj) { accessContext.Admins.Add(obj); accessContext.Entry(obj).State = EntityState.Added; }
public void Update(Mark obj) { accessContext.Entry(obj).State = EntityState.Modified; }
public void Insert(Product obj) { accessContext.Products.Add(obj); accessContext.Entry(obj).State = EntityState.Added; }
public void Put(Post post) { db.Entry(post).State = EntityState.Modified; db.SaveChanges(); }
public void Put(Profile profile) { db.Entry(profile).State = EntityState.Modified; db.SaveChanges(); }
public void Update(JournalSubject obj) { accessContext.Entry(obj).State = EntityState.Modified; }
public void Insert(Manager obj) { accessContext.Managers.Add(obj); accessContext.Entry(obj).State = EntityState.Added; }