Different @Model statement in Shopping Cart Index view

Sep 16, 2011 at 5:52 AM

I am new to MVC and I am working my way through your GREAT!! music store tutorial.  I'm having a great time and the accuracy of your tutorial puts most every other one I have used (and there are many!) to shame.

I have a simple question.

When I am creating the ShoppingCart index view, everything seemed to work correctly (no errors occurred), but the first line of the view file is different from your completed project.

In the file that I created, this is the first line:

  @model IEnumerable<MvcMusicStore02.ViewModels.ShoppingCartViewModel>

(My namespace is MvcMusicStore02)

In your completed project, the first line in the ShoppingCart index view file is this:

  @model MvcMusicStore.ViewModels.ShoppingCartViewModel

Using a diffmerge program, I confirmed that the code in my ShoppingCartViewModel.cs is identical to the complete project.

I have deleted the index.cshtml file and run this operation three times, but I get the same results every time. 

Can you tell me what am I doing wrong?

Thanks for your help.