コード例 #1
0
        public async Task <IActionResult> GetAll([FromQuery] string teacher)
        {
            if (teacher != null)
            {
                var result = await _subjectsRepository.ReadMatchingStudent(subject => subject.Teacher == teacher);

                return(Ok(result));
            }

            var allEntities = await _subjectsRepository.ReadAll();

            if (allEntities != null)
            {
                return(Ok(allEntities));
            }

            return(HttpNotFound());
        }