title: I am not able to generate a table with movies that I have hardcoded into my code using a partial view
body: <p>I am trying to generate a table with the header movies, and display two movie names in the rows below. I want to do this hard coded as I am fairly new to mvc. I have a movie model, a controller called moviescontroller and a view as well as a partial view. When I go to open up the browser I receive the following error &quot;CS0103: The name 'movie' does not exist in the current context
  &quot;, which I assume means it doesn't recognize my context of Movies that I am trying to display.</p>
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using WebApplication1.Models;
  
  namespace WebApplication1.ViewModels
  {
      public class MovieListViewModel
      {
          //View Model 
          public Movie Movie { get; set; }
          public List&lt;Movie&gt; Movies { get; set; }
      }
  }
  </code></pre>
  <pre><code>@model WebApplication1.ViewModels.MovieListViewModel
  @*
      View for Movies
  *@
  @{
      ViewBag.Title = &quot;Index&quot;;
      Layout = &quot;~/Views/Shared/_Layout.cshtml&quot;;
  }
  
  &lt;h2&gt;Movies&lt;/h2&gt;
  
  &lt;table id=&quot;movies&quot; class=&quot;table table-bordered table-hover&quot;&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Movie&lt;/th&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;@movie.Name&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;@movie.Name&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
      &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.Web.Mvc;
  using WebApplication1.Models;
  using WebApplication1.ViewModels;
  
  namespace WebApplication1.Controllers
  {
      public class MoviesController : Controller
      {
  
          public ActionResult Index()
          {
              //Action result Index 
              var movies = new List&lt;Movie&gt;
              {
                  new Movie {Name = &quot;Fast Furious&quot;},
                  new Movie {Name = &quot;Star Wars&quot;}
              };
              var viewModel = new MovieListViewModel
              {
                  Movies = movies,
                  
              };
              return View(viewModel);
  
          }
  }
  </code></pre>
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  
  namespace WebApplication1.Models
  {
      public class Movie
      {
  
          //Properties for Movie Model
          public int Id { get; set; }
          public string Name { get; set; }
  
      }
  }
  </code></pre>