public PackagesForSelectedPageResult2(IEnumerable <IPackage> packages, PackagesForSelectedPageQuery2 query)
 {
     this.Packages            = packages;
     this.TotalPackagesOnPage = packages.Count();
     this.TotalPackages       = query.TotalPackages;
     this.AllPackages         = query.AllPackages;
     this.Query = query;
 }
		public PackagesForSelectedPageResult2 (IEnumerable<IPackage> packages, PackagesForSelectedPageQuery2 query)
		{
			this.Packages = packages;
			this.TotalPackagesOnPage = packages.Count ();
			this.TotalPackages = query.TotalPackages;
			this.AllPackages = query.AllPackages;
			this.Query = query;
		}
Example #3
0
 IEnumerable <IPackage> GetFilteredPackagesBeforePagingResults(PackagesForSelectedPageQuery2 query)
 {
     if (query.AllPackages == null)
     {
         IQueryable <IPackage> packages = GetPackagesFromPackageSource(query.SearchCriteria);
         query.TotalPackages = packages.Count();
         query.AllPackages   = GetFilteredPackagesBeforePagingResults(packages);
     }
     return(query.AllPackages);
 }
Example #4
0
        void CreateReadPackagesTask()
        {
            var query = new PackagesForSelectedPageQuery2(this, allPackages, GetSearchCriteria());

            packagesForSelectedPageQuery = query;

            task = taskFactory.CreateTask(
                () => GetPackagesForSelectedPageResult(query),
                OnPackagesReadForSelectedPage);
        }
Example #5
0
 IEnumerable <IPackage> GetPackagesForSelectedPage(IEnumerable <IPackage> allPackages, PackagesForSelectedPageQuery2 query)
 {
     return(allPackages
            .Skip(query.Skip)
            .Take(query.Take));
 }
Example #6
0
        IEnumerable <IPackage> GetPackagesForSelectedPage(PackagesForSelectedPageQuery2 query)
        {
            IEnumerable <IPackage> filteredPackages = GetFilteredPackagesBeforePagingResults(query);

            return(GetPackagesForSelectedPage(filteredPackages, query));
        }
Example #7
0
        PackagesForSelectedPageResult2 GetPackagesForSelectedPageResult(PackagesForSelectedPageQuery2 query)
        {
            IEnumerable <IPackage> packages = GetPackagesForSelectedPage(query);

            return(new PackagesForSelectedPageResult2(packages, query));
        }