public IList <FeedBackView> QueryList(int appId, string menuCode = null) { Expression <Func <FeedBackEntity, bool> > where; if (menuCode == null) { where = x => x.AppID == appId; } else { where = x => x.AppID == appId && x.MenuCode == menuCode; } var list = Repository.Entities.Where(where).ToList(); var codes = list.Select(y => y.MenuCode).ToList(); //var categories = _categoryService.Repository.Entities.Where(x => codes.Contains(x.CategoryCode)).Select(x => new { code = x.CategoryCode, name = x.CategoryName }).ToList(); var viewList = list.Select(x => { //var category = categories.Find(y => y.code == x.MenuCode); var view = new FeedBackView(); view.ConvertAPIModel(x); //view.MenuName = category.name; return(view); }).ToList(); return(viewList); }
public async Task <IActionResult> FeedBack(FeedBackView model) { FeedBackDTO feedBackDTO = new FeedBackDTO(); { feedBackDTO.FirstName = model.FirstName; feedBackDTO.LastName = model.LastName; feedBackDTO.Email = model.Email; feedBackDTO.Description = model.Description; }; await _feedBackService.FeebBack(feedBackDTO); return(View("Index")); }
public int Create(FeedBackView item) { try { Entity.Feedback fb = new Entity.Feedback() { id = item.id, email = item.email, content = item.content, created = item.created, status = item.status }; db.Feedbacks.Add(fb); db.SaveChanges(); return(1); } catch (Exception) { return(0); } }
public static FeedBack EntityMap(this FeedBackView model) { return(Mapper.Map <FeedBackView, FeedBack>(model)); }
public int Update(FeedBackView item) { throw new NotImplementedException(); }