This project is read-only.

Add Image field to Album class

Jan 12, 2012 at 5:25 PM


Was wondering; Trying to expand a bit on this wonderful example app by adding an image to the album class. I tried using  

public HttpPostedFileBase Image { get; set; }

but I can't figure out how to populate this via SampleData.cs.

I also get a "value cannot be null" run-time error with this after adding the above in Album.cs class. I believe it's because I haven't populated it via SampleData.cs or that it cannot convert it to a list? Here it goes:

        private List<Album> GetTopSellingAlbums(int count)
            return storeDB.Albums
                .OrderByDescending(a => a.OrderDetails.Count())

Any help much appreciated!