コード例 #1
0
 public ActionResult <CategoryServicesMv> Get(int id)
 {
     try
     {
         var data = new CategoryServicesDao(_unitOfWork, _mapper).GetById(id);
         if (data == null)
         {
             return(NotFound());
         }
         return(data);
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
         return(NotFound());
     }
 }
コード例 #2
0
 public ActionResult <IEnumerable <CategoryServicesMv> > Get()
 {
     try
     {
         var data = new CategoryServicesDao(_unitOfWork, _mapper).GetAll();
         if (data == null)
         {
             return(NotFound());
         }
         return(data);
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
         return(NotFound());
     }
 }