Search Results

Search found 3 results on 1 pages for 'avh'.

Page 1/1 | 1 

  • Best way to transfer an Entity Framework object over the web and back via JSON

    - by AVH
    I've got some MVC code that serializes an EF 3.5 object into an anonymous type for return as a JSON result to an AJAX call on my page. The hurdle I have is that when I send the object back to the server via JSON, (and let the ModelBinder deserialize it for me into my EF type), I have to update it in my Entity Framework context manually. Or at least that's what I'm doing now. It has no EntityKey, so attaching it fails. I end up having to look up the old object and update it property by property. Any ideas around this? Is the solution to pass the EntityKey around with my object? Here's what I have: public void Update(Album album) { using (var db = new BandSitesMasterEntities()) { var albumToUpdate = db.Album.First(x => x.ID == album.ID); albumToUpdate.AlbumTitle = album.AlbumTitle; albumToUpdate.Description = album.Description; albumToUpdate.ReleaseYear = album.ReleaseYear; albumToUpdate.ImageURL = album.ImageURL; albumToUpdate.OtherURL = album.OtherURL; db.SaveChanges(); } } And here's what I'd like to do, or something similar: public void Update(Album album) { using (var db = new BandSitesMasterEntities()) { db.Attach(album) db.SaveChanges(); } }

    Read the article

  • Only show changed files while syncing from ext4 to NTFS

    - by qox
    I would like rsync to print modified and deleted files. The verbose option (-v) does print modified files but also the list of subdirectories, maybe because touched directories are considered modified. Since I sync a lot of files from a lot of subdirectories, it's impossible to see the actual changes. So, is there a way to not print directories using rsync ? Im not looking for grep -v "*/$" kind of answers since it would also exclude new directories. Command I am using: rsync -avh --delete /media/data/src /media/data/bkp And everytime it prints the list of all directories: src/dir1/ src/dir1/sdir1/ src/dir1/sdir2/ src/dir2/ ..... Thanks for your help. EDIT: Ok, after some intensive tests .. It doesn't print all directories when syncing from an ext4 partition to an ext4 and from NTFS to NTFS. It only does when syncing from ext4 to NTFS .. And options '-c' or '--omit-dir-times' don't change that.

    Read the article

  • Only show changed files with verbose option

    - by qox
    I would like rsync to print modified and deleted files. The verbose option (-v) does print modified files but also the list of subdirectories, maybe because touched directories are considered modified. Since I sync a lot of files from a lot of subdirectories, it's impossible to see the actual changes. So, is there a way to not print directories using rsync ? Im not looking for grep -v "*/$" kind of answers since it would also exclude new directories. Command I am using: rsync -avh --delete /media/data/src /media/data/bkp And everytime it prints the list of all directories: src/dir1/ src/dir1/sdir1/ src/dir1/sdir2/ src/dir2/ ..... Thanks for your help.

    Read the article

1