title: directive to be used to include viewmodel in mvc4
body: <p>I have gone through the MVC3 tutorial for displaying the related data in asp.net page.
  It has a viewmodel:</p>
  
  <pre><code>using System; 
  using System.Collections.Generic; 
  using ContosoUniversity.Models; 
  
  namespace ContosoUniversity.ViewModels 
  { 
      public class InstructorIndexData 
      { 
          public IEnumerable&lt;Instructor&gt; Instructors { get; set; } 
          public IEnumerable&lt;Course&gt; Courses { get; set; } 
          public IEnumerable&lt;Enrollment&gt; Enrollments { get; set; } 
      }
  }
  </code></pre>
  
  <p>and a controller, with actions:</p>
  
  <pre><code>using ContosoUniversity.ViewModels;
  
  public ActionResult Index(Int32? id, Int32? courseID) 
  { 
      var viewModel = new InstructorIndexData(); 
      viewModel.Instructors = db.Instructors 
                                .Include(i =&gt; i.OfficeAssignment) 
                                .Include(i =&gt; i.Courses.Select(c =&gt; c.Department)) 
                                .OrderBy(i =&gt; i.LastName); 
  
      if (id != null) 
      { 
          ViewBag.InstructorID = id.Value; 
          viewModel.Courses = viewModel.Instructors.Where(i =&gt; i.InstructorID ==         id.Value).Single().Courses; 
      } 
  
      if (courseID != null) 
      { 
          ViewBag.CourseID = courseID.Value; 
          viewModel.Enrollments = viewModel.Courses.Where(x =&gt; x.CourseID ==  courseID).Single   ().Enrollments; 
      } 
  
      return View(viewModel); 
  }
  </code></pre>
  
  <p>when i tried in MVC4 it is such that <strong>using ContosoUniversity.ViewModels;</strong> is not existing</p>
  
  <p>and at</p>
  
  <pre><code>viewModel.Courses = viewModel.Instructors.Where(i =&gt; i.InstructorID ==            id.Value).Single().Courses; 
  </code></pre>
  
  <p>it is getting error as cannot convert viewmodel.instructors to <code>IEnumerable&lt;viewmodel.Instructors&gt;</code></p>