public ActionResult <ClassesReadDTO> GetClassesById(int id)
 {
     try
     {
         var result = repository.GetById(id);
         if (result != null)
         {
             return(Ok(mapper.Map <ClassesReadDTO>(result)));
         }
         return(NotFound());
     }
     catch (System.Exception msg)
     {
         return(NotFound(msg));
     }
 }
예제 #2
0
 // GET: api/Classes/5
 public @class Get(int id)
 {
     return(_repository.GetById(id));
 }
예제 #3
0
        public async Task <IActionResult> Get(int id)
        {
            var @class = await _repository.GetById(id);

            return(Ok(@class));
        }