title: Accessing Controller variable in View MVC
body: <p>I have started to use MVC  and i have set up a simple project that has a controller than returns a value from entity FrameWork. I have a controller for the index page which visual studio setup as default in its template. </p>
  
  <p>I am hoping that this value will be returned to the index page of the website.</p>
  
  <p>Controller code</p>
  
  <pre><code> MISEntities db = new MISEntities();
  
      public ActionResult Index()
      {
          ViewBag.Message = "Real Time Production";
  
          var scrap = from r in db.tbl_dppIT
                          select r.CastGood; 
  
          return View(scrap);
      }
  </code></pre>
  
  <p>How do i access the var scrap using razor?
  I have looked at the viewbag method and other razor syntax but cant seem to find how i access this item. </p>