// GET: Student public ActionResult Index() { using (DBcrudEntities1 db = new DBcrudEntities1()) return(View(db.Students.ToList())); Console.WriteLine("listed"); Console.WriteLine("listeddgdgd"); }
public ActionResult Create(Student student) { try { using (DBcrudEntities1 db = new DBcrudEntities1()) { db.Students.Add(student); db.SaveChanges(); } // TODO: Add insert logic here return(RedirectToAction("Index")); } catch { return(View()); } }