예제 #1
0
        public async Task <ActionResult> Edit(NewStudentInfo nc)
        {
            if (ModelState.IsValid)
            {
                _db.Update(nc);
                await _db.SaveChangesAsync();

                return(View("Index"));
            }
            return(View(nc));
        }
예제 #2
0
        public async Task <IActionResult> Create(NewStudentInfo nec)

        {
            if (ModelState.IsValid)
            {
                _db.Add(nec);
                await _db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(nec));
        }