protected override void Dispose(bool disposing) { if (disposing) { db.Dispose(); } base.Dispose(disposing); }
// GET: Tuotteet public ActionResult Index() { ViewBag.Haku = "Tuotehaku"; TilausDb3Entities db = new TilausDb3Entities(); List <Tuotteet> model = db.Tuotteet.ToList(); //return View(db.Tuotteet.ToList()); db.Dispose(); return(View(model)); }