예제 #1
0
        public async Task <IActionResult> Post([FromBody] Student student)
        {
            await _context.Students.AddAsync(student);

            await _context.SaveChangesAsync();

            return(Ok(student));
        }
        public async Task <IActionResult> Post([FromBody] Course course)
        {
            await _context.Courses.AddAsync(course);

            await _context.SaveChangesAsync();

            return(Ok(course));
        }
예제 #3
0
        public async Task <IActionResult> Post([FromBody] Teacher teacher)
        {
            await _context.Teachers.AddAsync(teacher);

            await _context.SaveChangesAsync();

            return(Ok(teacher));
        }