public async Task <IActionResult> PutCategory(int id, Category category) { if (id != category.CategoeryId) { return(BadRequest()); } _context.Entry(category).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CategoryExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutPhotosAlbum(int id, PhotosAlbum photosAlbum) { if (id != photosAlbum.PhotoId) { return(BadRequest()); } _context.Entry(photosAlbum).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PhotosAlbumExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }