コード例 #1
0
        public async Task <ActionResult <Pertence> > Create([FromBody] Pertence pertence)
        {
            if (ModelState.IsValid)
            {
                _context.Pertence.Add(pertence);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(pertence);
        }
コード例 #2
0
        public async Task <ActionResult <Curso> > Create([FromBody] Curso curso)
        {
            if (ModelState.IsValid)
            {
                _context.Add(curso);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(curso);
        }
コード例 #3
0
        public async Task <ActionResult <Professor> > Create([FromBody] Professor professor)
        {
            if (ModelState.IsValid)
            {
                _context.Add(professor);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(professor);
        }
コード例 #4
0
        public async Task <ActionResult <Disciplina> > Create([FromBody] Disciplina disciplina)
        {
            if (ModelState.IsValid)
            {
                _context.Add(disciplina);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(disciplina);
        }
コード例 #5
0
        public async Task <ActionResult <Possui> > Create([FromBody] Possui possui)
        {
            if (ModelState.IsValid)
            {
                _context.Possui.Add(possui);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(possui);
        }
コード例 #6
0
        public async Task <ActionResult <Ofertar_Turma_Disciplina_Sala> > Create([FromBody] Ofertar_Turma_Disciplina_Sala ofertar)
        {
            if (ModelState.IsValid)
            {
                _context.Ofertar_Turma_Disciplina_Sala.Add(ofertar);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(ofertar);
        }
コード例 #7
0
        public async Task <ActionResult <Lecionar> > Create([FromBody] Lecionar lecionar)
        {
            if (ModelState.IsValid)
            {
                _context.Lecionar.Add(lecionar);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(lecionar);
        }