The viewmodel is now ok but I am still getting some errors in the controller:
Error 1 'Component2.ViewModels.IndexViewModel' does not contain a definition for 'Count' and no extension method 'Count' accepting a first argument of type 'Component2.ViewModels.IndexViewModel' could be found (are you missing a using directive or an assembly
reference?)
Error 2 foreach statement cannot operate on variables of type 'Component2.ViewModels.IndexViewModel' because 'Component2.ViewModels.IndexViewModel' does not contain a public definition for 'GetEnumerator'
uzzy
0 Points
116 Posts
Re: Music Store Tutorial: Store View
Apr 06, 2012 06:17 PM|LINK
I really appreciate all this mate.
The viewmodel is now ok but I am still getting some errors in the controller:
Error 1 'Component2.ViewModels.IndexViewModel' does not contain a definition for 'Count' and no extension method 'Count' accepting a first argument of type 'Component2.ViewModels.IndexViewModel' could be found (are you missing a using directive or an assembly reference?)
Error 2 foreach statement cannot operate on variables of type 'Component2.ViewModels.IndexViewModel' because 'Component2.ViewModels.IndexViewModel' does not contain a public definition for 'GetEnumerator'
Below is the code:
@model Component2.ViewModels.IndexViewModel
@{
ViewBag.Title ="Store";
}
<p>
Select from @Model.Count() Genre's:
</p>
<ul>
@foreach (var genre in Model)