public AppOpinionDomainModelList GetAppOpinionList(QueryAppOpinionDomainModel query) { var select = from appoption in Context.Set <AppOpinionEntity>().AsNoTracking() join customer in Context.Set <CustomerInfoEntity>().AsNoTracking() on appoption.CreateCid equals customer.Cid join corp in Context.Set <CorporationEntity>().AsNoTracking() on customer.CorpID equals corp.CorpId select new AppOpinionDomainModel { Id = appoption.Id, AppOpinion = appoption.AppOpinion, AppType = appoption.AppType, ContactName = customer.RealName, CreateCid = appoption.CreateCid, CreateTime = appoption.CreateTime, CustomerName = corp.CorpName }; AppOpinionDomainModelList appOpinionList = new AppOpinionDomainModelList(); appOpinionList.TotalCount = select.Count(); if (appOpinionList.TotalCount > 0) { appOpinionList.AppOpinionList = new List <AppOpinionDomainModel>(); appOpinionList.AppOpinionList.AddRange(select.OrderByDescending(x => x.CreateTime).Skip((query.PageIndex - 1) * query.PageSize).Take(query.PageSize)); } return(appOpinionList); }
public GetAppOpinionListResponseViewModel GetAppinionList(GetAppOpinionListRequestViewModel query) { AppOpinionDomainModelList resultModel = _GetAppOpinionListServiceBll.GetAppOpinionList(new QueryAppOpinionDomainModel() { PageSize = query.PageSize, PageIndex = query.PageIndex }); return(Mapper.Map <AppOpinionDomainModelList, GetAppOpinionListResponseViewModel>(resultModel)); }