Пример #1
0
        // GET: Student
        public ActionResult Index()
        {
            using (DBcrudEntities1 db = new DBcrudEntities1())
                return(View(db.Students.ToList()));

            Console.WriteLine("listed");
            Console.WriteLine("listeddgdgd");
        }
Пример #2
0
        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());
            }
        }