Ejemplo n.º 1
0
        public IActionResult Index()
        {
            var v = _schoolDbContext.Database.EnsureCreated();

            if (v)
            {
                _schoolDbContext.CreateDatabasescri();
            }
            _schoolDbContext.Set <Course>().Add(new Course()
            {
                Coursename = "MCA"
            });
            _schoolDbContext.SaveChanges();
            //_schoolDbContext.BaseEntities
            //DbInitilizer.Initialize(_schoolDbContext);
            //ViewBag.aa = _Student.Getsomestring();
            //ViewBag.bb = _course.courses();
            //var STU=_schoolDbContext.RegStudents.ToList();
            return(View());
        }