Esempio n. 1
0
 public void RegisterStudentToCourse(StudentCourseOffering offering)
 {
     using (var context = new ApplicationDbContext())
     {
         context.StudentCourseOfferings.Add(offering);
         context.SaveChanges();
     }
 }
        public IActionResult Create([FromBody] StudentCourseOffering studentCourseOffering)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            _service.Add(studentCourseOffering);
            return(Ok(studentCourseOffering));
        }
        public IActionResult Update([FromBody] StudentCourseOffering studentCourseOffering, int id)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            studentCourseOffering.Id = id;
            _service.Update(studentCourseOffering);
            return(Ok(studentCourseOffering));
        }
Esempio n. 4
0
 public void RegisterStudentToCourse(StudentCourseOffering offering)
 {
     _repository.RegisterStudentToCourse(offering);
 }