Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Contributor
3176 Points
705 Posts
Apr 06, 2012 06:07 PM|LINK
Sorry, you got that error because we didn't include the namespace in your viewmodel. Below is what your viewmodel should finally look like.
using System; using System.Collections.Generic; using System.Linq; using System.Web; using Component2.Models;
namespace Component2.ViewModels {
public class IndexViewModel { public List<Genre> Genres { get; set; } public List<Artist> Directors { get; set; }
public IndexViewModel(List<Genre> _genres, List<Director> _directors) { Genres = _genres; Directors = _directors; } } }
Lastly, @model ViewModels.IndexViewModel should be @model Component2.ViewModels.IndexViewModel
I should start copying and pasting code from VS instead of going off memory :P
JohnLocke
Contributor
3176 Points
705 Posts
Re: Music Store Tutorial: Store View
Apr 06, 2012 06:07 PM|LINK
Sorry, you got that error because we didn't include the namespace in your viewmodel. Below is what your viewmodel should finally look like.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Component2.Models;
namespace Component2.ViewModels {
public class IndexViewModel {
public List<Genre> Genres { get; set; }
public List<Artist> Directors { get; set; }
public IndexViewModel(List<Genre> _genres, List<Director> _directors) {
Genres = _genres;
Directors = _directors;
}
}
}
Lastly, @model ViewModels.IndexViewModel should be @model Component2.ViewModels.IndexViewModel
I should start copying and pasting code from VS instead of going off memory :P