Limit the list return from the index view

Jul 31, 2010 at 2:17 PM

Great tutorila, learning alot from it!

 

Quick question in the following code:

public ActionResult Index()
{
var albums = storeDB.Albums
.Include("Genre").Include("Artist")
.ToList();
return View(albums);
}

This generates a list of albums, if I want to add a .where clause to say for example just want to list the albums from the G0-G0's, How would I accomplish this.

 

Also supposed I want to restrict the list to a particuliar session id as a favorites oprion.  If I had a session is created as glenn) how could I restrict the list to say album.Names == Glenn

 

Thanks