public void SaveAlbum(Album album)
        {
            if (album == null) throw new ArgumentNullException("album");

            var q = from x in GetAlbums()
                    where x.AlbumID == album.AlbumID
                    select x;
            var dbItem = q.FirstOrDefault();
            if (dbItem == null)
            {
                dbItem = new Album();
                InMemoryCache.Albums.Add(dbItem);
            }

            dbItem.Title = album.Title;
            dbItem.ArtistID = album.ArtistID;
        }
 public AlbumEditViewModel(Chinook.DomainModel.Album album, Chinook.Repository.IMusicRepository musicRepository)
 {
     Album   = new AlbumInputModel(album);
     Artists = new SelectList(musicRepository.GetArtists(), "ID", "Name", album.ArtistID);
 }
 public AlbumInputModel(Album album)
 {
     this.AlbumID = album.AlbumID;
     this.Title = album.Title;
     this.ArtistID = album.ArtistID;
 }