using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; ///////////////////////////////////////////////////////////////////////////// // Add the "using" statement ///////////////////////////////////////////////////////////////////////////// using TierData; // added this line namespace MvcOnPremiseToCloud.Controllers { [HandleError] public class HomeController : Controller { public ActionResult Index() { ///////////////////////////////////////////////////////////////////////////// // Add the next 2 lines of code ///////////////////////////////////////////////////////////////////////////// MarketIndexDataEntities _db = new MarketIndexDataEntities(); // added this line // We will execute a LINQ query to get data ViewData.Model = (from m in _db.AssetPrices select m).ToList(); // added this line // ASP.NET MVC makes it easy to pass data from a controller to a view, // using the ViewData dictionary or, in the case of strongly-typed views, // passing the model class directly to it ViewData["Message"] = "Hello from this On-Premise MVC App"; return View(); } public ActionResult About() { return View(); } } }