public ActionResult List(PagerRequest request, SectionSearchOption search)
        {
            int totalCount;
            var linq = _sectionRepo.Get(s => (!search.SId.HasValue || search.SId.Value == s.Id) &&
                                        (string.IsNullOrEmpty(search.Name) || s.Name.StartsWith(search.Name)) &&
                                        (!search.BrandId.HasValue || search.BrandId.Value == s.BrandId) &&
                                        (!search.StoreId.HasValue || search.StoreId.Value == s.StoreId) &&
                                        s.Status != (int)DataStatus.Deleted
                                        , out totalCount
                                        , request.PageIndex
                                        , request.PageSize
                                        , e => e.OrderByDescending(o => o.CreateDate));
            var data = linq.Join(_storeRepo.GetAll(), o => o.StoreId, i => i.Id, (o, i) => new { S = o, Store = i })
                       .Join(_brandRepo.GetAll(), o => o.S.BrandId, i => i.Id, (o, i) => new { S = o.S, Store = o.Store, B = i })
                       .ToList()
                       .Select(l => new SectionViewModel().FromEntity <SectionViewModel>(l.S, p => {
                p.Store = new StoreViewModel().FromEntity <StoreViewModel>(l.Store);
                p.Brand = new BrandViewModel().FromEntity <BrandViewModel>(l.B);
            }));


            var v = new Pager <SectionViewModel>(request, totalCount)
            {
                Data = data.ToList()
            };

            return(View("List", v));
        }
 public ActionResult Index(PagerRequest request, SectionSearchOption search)
 {
     return(List(request, search));
 }