public Genre GetWithAlbums(string genreName)
        {
            using (var cn = MusicStoreConnection)
            {
                var dr = cn.ExecuteReader(
                    "SELECT * " +
                    "  FROM Genre G" +
                    "  JOIN Album A ON A.GenreId = G.GenreId" +
                    " WHERE G.Name = @Name", new {Name = genreName});

                Genre genre = null;
                while (dr.Read())
                {
                    if (genre == null)
                    {
                        genre = new Genre
                        {
                            GenreId = Convert.ToInt32(dr["GenreId"]),
                            Name = dr["Name"].ToString(),
                            Description = dr["Description"].ToString()
                        };
                    }

                    genre.Albums.Add(new Album
                    {
                        AlbumId = Convert.ToInt32(dr["AlbumId"]),
                        Title = dr["Title"].ToString(),
                        Price = Convert.ToDecimal(dr["Price"]),
                        AlbumArtUrl = dr["AlbumArtUrl"].ToString(),
                        GenreId = Convert.ToInt32(dr["GenreId"]),
                        Genre = genre
                    });
                }
                return genre;
            }
        }
 public static GenreMenuViewModel ToViewModel(Genre genre)
 {
     return Mapper.Map<GenreMenuViewModel>(genre);
 }