当前位置: 首页>>代码示例>>C#>>正文


C# IPagedList.Select方法代码示例

本文整理汇总了C#中IPagedList.Select方法的典型用法代码示例。如果您正苦于以下问题:C# IPagedList.Select方法的具体用法?C# IPagedList.Select怎么用?C# IPagedList.Select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IPagedList的用法示例。


在下文中一共展示了IPagedList.Select方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FromAuctions

		public static AccountMyAuctionsViewModel FromAuctions(IPagedList<Auction> auctions,
		                                                      string titleFilter,
		                                                      int createdInDays,
		                                                      AuctionStatusFilter currentStatusFilter)
		{
			Contract.Requires(auctions != null);

			var items = auctions.Select(x => new AccountMyAuctionsViewModel.Item
			{
				Id           = x.Id,
				Title        = x.Title,
				CategoryName = x.Category.Name,
				CategoryId   = x.Category.Id,
				Status       = x.Status,
				TimeTillEnd  = x.EndDate - DateTime.Now,
				BuyoutPrice  = x.BuyoutPrice,
				BestOffer    = x.BestOffer != null ? x.BestOffer.Money : null
			});

			return new AccountMyAuctionsViewModel
			{
				Auctions            = new StaticPagedList<AccountMyAuctionsViewModel.Item>(items, auctions),
				TitleFilter         = titleFilter,
				CreatedIn           = TimeSpan.FromDays(createdInDays),
				CurrentStatusFilter = currentStatusFilter
			};
		}
开发者ID:Strachu,项目名称:Auctioneer,代码行数:27,代码来源:AccountMyAuctionsViewModelMapper.cs

示例2: RegistryItemsPage

 public RegistryItemsPage(IPagedList<Gift> gifts, IEnumerable<Category> categories, int pageSize,int selectedCategory)
 {
     Gifts =gifts.Select((gift, i) => new GiftRow {Item = gift, IsFirst = i == 0});
     Categories = categories.ToList();
     TotalNumberOfItems = gifts.TotalItemCount;
     PageNumber = gifts.PageNumber;
     PageCount = gifts.PageCount;
     FirstItemIndex = gifts.FirstItemIndex;
     LastItemIndex = gifts.LastItemIndex;
     PageSize = pageSize;
     SelectedCategoryId = selectedCategory;
 }
开发者ID:ammeep,项目名称:giftme,代码行数:12,代码来源:RegistryItemsPage.cs

示例3: FromAuctions

		public static CategoryIndexViewModel FromAuctions(IPagedList<Auction> auctions,
		                                                  AuctionSortOrder currentSortOrder,
		                                                  int? categoryId = null)
		{
			Contract.Requires(auctions != null);

			return new CategoryIndexViewModel
			{
				CategoryId       = categoryId,
				Auctions         = new StaticPagedList<AuctionViewModel>(auctions.Select(AuctionViewModelMapper.FromAuction),
				                                                         auctions),
				CurrentSortOrder = currentSortOrder,
			};
		}
开发者ID:Strachu,项目名称:Auctioneer,代码行数:14,代码来源:CategoryIndexViewModelMapper.cs

示例4: FromUsers

		public static UsersIndexViewModel FromUsers(IPagedList<User> users, UserSortOrder currentSortOrder)
		{
			Contract.Requires(users != null);

			var items = users.Select(x => new UsersIndexViewModel.Item
			{
				Id            = x.Id,
				UserName      = x.UserName,
				RealName      = x.FullName,
				IsBanned      = x.IsBanned,
				BanExpiryTime = x.LockoutEndDateUtc.HasValue ? x.LockoutEndDateUtc.Value.ToLocalTime() : (DateTime?)null
			});

			return new UsersIndexViewModel
			{
				Users            = new StaticPagedList<UsersIndexViewModel.Item>(items, users),
				CurrentSortOrder = currentSortOrder
			};
		}
开发者ID:Strachu,项目名称:Auctioneer,代码行数:19,代码来源:UsersIndexViewModelMapper.cs

示例5: Convert

        private IEnumerable<SaleProductModel> Convert(IPagedList<productDto> sources)
        {
            if (sources == null) return null;

            return sources.Select(t =>
                     {
                         var data = new SaleProductModel()
                         {
                             brandname = t.brand.name,
                             categoryname = t.category.name,
                             gendername = t.gender.name,
                             unitprice = t.unitprice,
                             code = t.code,
                             name = t.name,
                             imgpath = t.imagemain,
                             productid = t.key
                         };
                         data.details.AddRange(t.v_stocks.Select(o => new SaleProductDetailModel()
                         {
                             productid = t.key,
                             size = o.size.code,
                             displaysize = o.size.displaycode,
                             sizeid = o.sizeid,
                             stockquantity = o.stockquantity
                         }));
                         return data;
                     });
        }
开发者ID:ncqingchuan,项目名称:Hyde,代码行数:28,代码来源:ProductService.cs

示例6: GetPagedComplaintList

 private IPagedList<ComplaintViewModel> GetPagedComplaintList(IPagedList<Complaint> complaints)
 {
     var complaintViewModels = complaints.Select(c => _complaintBuilder.BuildViewModel(c)).ToList();
     return new PagedList<ComplaintViewModel>(complaintViewModels, complaints.PageIndex, complaints.PageSize, complaints.TotalItemCount);
 }
开发者ID:mattapayne,项目名称:Complainatron-MVC,代码行数:5,代码来源:ComplaintController.cs


注:本文中的IPagedList.Select方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。