public IHttpActionResult GetLecturer(int id)
      {
          Lecturer Lecturer = lecturerRepo.Get(id);

          if (Lecturer == null)
          {
              return(NotFound());
          }



          LecturerDTO LecturerDTO = Mapper.Map <LecturerDTO>(Lecturer);

          return(Ok(LecturerDTO));
      }
예제 #2
0
 public async Task <IEnumerable <LecturerModel> > Handle(LecturerQuery request, CancellationToken cancellationToken)
 {
     if (request.searchTerm == null)
     {
         return(await _repository.GetAll());
     }
     else
     {
         return(await _repository.Get(request.searchTerm.ToLower()));
     }
 }