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)); } }
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" } }); } }