예제 #1
0
 public async Task <ActionResult <IEnumerable <Work> > > Get()
 {
     try
     {
         return(await db.Works.Include(x => x.Images).ToListAsync());
     }
     catch (Exception ex)
     {
         _logger.LogException(ex);
         return(BadRequest(ex));
     }
 }
예제 #2
0
 public IEnumerable <Comment> Get()
 {
     try
     {
         bool isOkStatus = _managerLoginAdmin.IsStatusOK(HttpContext);
         return(db.Comments.Where(x => (isOkStatus | x.Approved)).ToList());
     }
     catch (Exception ex)
     {
         _logger.LogException(ex);
         return(new List <Comment>()
         {
             new Comment()
             {
                 Name = "Error"
             }
         });
     }
 }