I'm trying to pass the counts of three different tables into a view along with a list of albums. It's a mod of the MvcMusicStore tutorial. I'm getting the "The ObjectContext instance has been disposed and can no longer be used..." error. I understand that it has to do with lazy loading, but I can't figure out how to make it work. 

```
// Controller
public class StoreManagerController : Controller
{
    private MusicStoreDBEntities context = new MusicStoreDBEntities();  

    public ActionResult Index()
    {
        // counts
        ViewData["artistCount"] = context.Artists
                                     .Select(e => new { e.ArtistId }).Count();
        ViewData["genreCount"] = context.Genres
                                     .Select(e => new { e.GenreId }).Count();
        ViewData["albumCount"] = context.Albums
                                     .Select(e => new { e.AlbumId }).Count();

        // also tried two other ways...same result. 
        //ViewData["artistCount"] = context.Artists
                                 .Select(e => new { e.ArtistId }).ToList().Count;
        //ViewData["artistCount"] = context.Artists
                                 .Select(e => new { e.ArtistId }).ToList().Count();

        // album list
        var albums = context.Albums.Include(a => a.Genre).Include(a => a.Artist);
        return View(albums.ToList());
    }
}

// View - Index.cshtml  
@model IEnumerable<MVC_App1.Models.Album>
<div>
<label><strong>Database Counts:</strong></label>
    Albums: @ViewData["albumCount"] ...
    Artists: @ViewData["artistCount"]  ...
    Genres: @ViewData["genreCount"]
</div>  

<table>
@foreach (var item in Model) {
<tr>
    <td>
        @Html.DisplayFor(modelItem => item.Genre.Name)
    </td>
    <td>
        @Html.DisplayFor(modelItem => item.Artist.Name)
    </td>
    <td>
        @Html.DisplayFor(modelItem => item.Title)
    </td>
    <td>
        @Html.DisplayFor(modelItem => item.Price)
    </td>
    <td>
        @Html.DisplayFor(modelItem => item.AlbumArtUrl)
    </td>
</tr>
}
</table>

```

SOLUTION:

So I went with the suggestion to add a new model. 

```
public class AlbumsCollection 
{
    public IEnumerable<Album> Albums = new List<Album>();
    public IEnumerable<Artist> Artists = new List<Artist>();
    public IEnumerable<Genre> Genres = new List<Genre>();
}

```

And then do the counts in the view. I realized that I m passing the whole Album list to the view anyway, so it isn't a slowdown there. And For the Artists and Genres...there won't be many anyway, as they are 1-to-many relationships. I guess that's giving up on doing the Counts in the controller....but I guess this is good enough.