public async Task <IActionResult> AddSubject([FromBody] SubjectEditModel subjectForUpdate)
        {
            var subject = await _quantumITAppService.AddSubjectAsync(subjectForUpdate);

            return(Ok(subject));

            throw new Exception($"adding new subject failed!");
        }
Beispiel #2
0
        public async Task <IActionResult> AddSubject([FromBody] SubjectEditModel subjectForUpdate)
        {
            var subject = await _quantumITAppService.AddSubjectAsync(subjectForUpdate);

            if (subject == null)
            {
                return(BadRequest("Subject with this name already exists!"));
            }
            return(Ok(subject));
        }