Ejemplo n.º 1
0
        public void UpdateAlbum(Album album)
        {
            _context.Albums.Attach(album);
            var albumFromDb = _context.Entry(album);

            albumFromDb.State = EntityState.Modified;
            albumFromDb.Property(alb => alb.Created).IsModified  = false;
            albumFromDb.Property(phot => phot.UserId).IsModified = false;
        }
Ejemplo n.º 2
0
        public void UpdatePhoto(Photo photo)
        {
            _context.Photos.Attach(photo);
            var photoFromDb = _context.Entry(photo);

            photoFromDb.State = EntityState.Modified;
            photoFromDb.Property(phot => phot.Created).IsModified = false;
            photoFromDb.Property(phot => phot.UserId).IsModified  = false;
            photoFromDb.Property(phot => phot.ImageId).IsModified = false;
        }