Hi,
I'm finding it quite difficult to follow the code samples in Chapter 3 (Views).
I can see that NuGet has installed a Samples folder, but the samples dont work.
When I run
http://localhost:6715/Albums/ListStronglyTyped, I get:
The model item passed into the dictionary is of type 'System.Collections.Generic.List`1[MvcMusicStore.Controllers.Album]', but this dictionary requires a model item of type 'System.Collections.Generic.IEnumerable`1[MvcMusicStore.Models.Album]'.
When I run
http://localhost:6715/Albums/ListWeaklyTyped
I get errors on Line 4 below:
Object reference not set to an instance of an object.
Line 2:
Line 3: <ul>
Line 4: @foreach(Album p in (ViewBag.Albums as IEnumerable<Album>)) {
Line 5: <li>@p.Title</li>
Line 6: }
Help !!!