コード例 #1
0
        public IActionResult Get([FromQuery] string name)
        {
            IEnumerable <Classroom> result;

            if (!string.IsNullOrWhiteSpace(name))
            {
                result = _classroomRepository.Find(name);
            }
            else
            {
                result = _classroomRepository.Fetch();
            }
            var results = Mapper.Map <IEnumerable <ClassroomModel> >(result);

            return(new ObjectResult(results));
        }
コード例 #2
0
 public Classroom getByIdAsync(int id) => _repository.Find(x => x.Id == id);