public async Task <IActionResult> Create(Student student)
        {
            if (ModelState.IsValid)
            {
                _context.Add(student);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            else
            {
                return(BadRequest());
            }
        }
        public async Task <IActionResult> Create([Bind("AmbionId,AmbionName,AmbionStatus")] Ambion Ambion)
        {
            if (ModelState.IsValid)
            {
                _context.Add(Ambion);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            else
            {
                return(BadRequest());
            }
        }
Exemplo n.º 3
0
        public async Task <IActionResult> Create([Bind("GradeId,GradeName,GradeStatus")] Grade grade)
        {
            if (ModelState.IsValid)
            {
                _context.Add(grade);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            else
            {
                return(BadRequest());
            }
        }