public List <FeedbackDTO> GetListDTOs(int productId) { using (FeedbackDAO db = new FeedbackDAO(_context)) { var listFback = LsObjectMapperTo <Feedback, FeedbackDTO>(db.GetList(productId)); if (listFback == null) { return(listFback); } listFback.ForEach(item => { var UserName = _context.Users.Find(item.UserId)?.Name; item.UserName = UserName; }); return(listFback); } }
public string GetManagerFeedback(int page = 1) { IList <FeedbackModel> list = new List <FeedbackModel>(); MyResponse <IList <FeedbackModel> > myResponse = new MyResponse <IList <FeedbackModel> >(); if (IsLoggedIn()) { try { list = FeedbackDAO.GetList(new Pagination() { currentPage = page }); myResponse.success = true; myResponse.data = list; } catch (Exception ex) { myResponse.message = ex.Message; } } return(JsonConvert.SerializeObject(myResponse)); }